P15794 [CodeChef] EQUALISE
普及-
题目描述

Chef has two numbers A and B.

In one operation, Chef can choose either A or B and multiply it by 2.

Determine whether he can make both A and B equal after any number (possibly, zero) of moves.

------ Input Format ------

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • Each test case consists of two space-separated integers A and B.

------ Output Format ------

For each test case, output YES if Chef can make both numbers equal, NO otherwise.

Note that the checker is case-insensitive i.e. YES, Yes, yes, yES are all considered same.

------ Constraints ------

$1 ≤ T ≤ 2500$
$1 ≤ A, B ≤ 50$

----- Sample Input 1 ------
4
5 20
6 6
12 2
50 20

----- Sample Output 1 ------
YES
YES
NO
NO

----- explanation 1 ------
Test case $1$: Chef can multiply $A$ by $2$ twice and both $A$ and $B$ will become $20$.

Test case $2$: Both numbers are already equal.

Test case $3$: It can be shown that $A$ and $B$ cannot be made equal.

Test case $4$: It can be shown that $A$ and $B$ cannot be made equal.

输入格式

见题面

输出格式

见题面

样例输入
4 5 20 6 6 12 2 50 20
样例输出
YES YES NO NO