CF1977A.Little Nikita

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

Little Nikita

The little boy Nikita was given some cubes as a present. He decided to build a tower out of them.

Initially, the tower doesn't have any cubes. In one move, Nikita either puts exactly 11 cube on top of the tower or removes exactly 11 cube from the top of the tower. Is it possible that after nn moves, the resulting tower has exactly mm cubes?

Input

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

The only line of each test case contains two integers nn and mm (1n,m1001 \le n, m \le 100).

Output

For each test case, output "Yes" (without quotes) if Nikita can obtain a tower with mm cubes, and "No" (without quotes) 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

In the first test case, Nikita can put 11 cube on top of the tower 33 times in a row, so the answer is "Yes".

In the second test case, Nikita can only end up with either a tower with no blocks or a tower with 22 blocks, so the answer is "No".

Samples

3
3 3
2 4
5 3
Yes
No
Yes

在线编程 IDE

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