Sheldon and Leonard are roommates. Usually Leonard drives Sheldon to work everyday as Sheldon can’t drive and hates bus. For some reason, Leonard has gone to his home for indefinitely. So, Sheldon asks Penny who lives across the hall to drive him to work. As we all know Sheldon is and annoying person to be with and Penny hates to get up at 7am! So, they signed a contract which states the following-
Sheldon gives Penny two integers and . Sheldon wants to know if there are two positive integers and such that difference between and is exactly and (greatest common divisor) between and must be . i.e. and .
The problem will be given to Penny every night. If she gives the correct answer, Sheldon will take the bus next morning. Otherwise she will have to get up early and she doesn’t want ruin her precious sleep. So, she hires you to write a program which will give correct answer to the above problem.
The first line contains an integer -the number of tests.
The following lines describe the tests.
Each test contains two positive integers and .
For each test case, in single line print if there are no such and which fulfill Sheldon’s conditions else print .
Input | Output |
---|---|
2 20 4 23 5 | Yes No |