D. Sakurako's Exam

    传统题 1000ms 256MiB

Sakurako's Exam

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem

Today, Sakurako has a math exam. The teacher gave the array, consisting of aa ones and bb twos. In an array, Sakurako must place either a '+' or a '-' in front of each element so that the sum of all elements in the array equals 0.0.

Sakurako is not sure if it is possible to solve this problem, so determine whether there is a way to assign signs such that the sum of all elements in the array equals 0.0.

Input

The first line contains a single integer tt (1t100)(1≤t≤100) — the number of test cases.

The only line of each test case contains two integers aa and bb (0a,b<10)(0≤a,b<10) — the number of '1's and the number of '2's in the array.

Output

For each test case, output "YES" if you can make the sum of the entire array equal to 0,0, and "NO" otherwise.

Example : in

5
0 1
0 3
2 0
2 3
3 1

Example : out

NO
NO
YES
YES
NO

语法基础(数组、字符串及数据批量存储)+ 压力

未参加
状态
已结束
规则
ACM/ICPC
题目
6
开始于
2024-10-11 19:00
结束于
2024-10-12 0:00
持续时间
5 小时
主持人
参赛人数
7