CF2008A.Sakurako's Exam

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Sakurako's Exam

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 00.

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 00.

Input

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

The only line of each test case contains two integers aa and bb (0a,b<100\le a,b \lt 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 00, and "No" otherwise.

You can output each letter in any case (lowercase or uppercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be accepted as a positive answer.

Note

  1. a=0a=0, b=1b=1: This means the array is [2][2] — it is impossible to add the signs '+' or '-' to get 00 as a result;
  2. a=0a=0, b=3b=3: This means the array is [2,2,2][2, 2, 2] — it is impossible to add the signs '+' or '-' to get 00 as a result;
  3. a=2a=2, b=0b=0: This means the array is [1,1][1, 1] — it is possible to add the signs '+' or '-' to get 00 as a result (+11=0+1-1=0);
  4. a=2a=2, b=3b=3: This means the array is [1,1,2,2,2][1, 1, 2, 2, 2] — it is possible to add the signs '+' or '-' to get 00 as a result (+1+122+2=0+1+1-2-2+2=0);

Samples

5
0 1
0 3
2 0
2 3
3 1
NO
NO
YES
YES
NO

在线编程 IDE

建议全屏模式获得最佳体验