You are given receipts and must check whether they are valid.
One way to identify a fraudulent receipt is to check whether its tax calculation is incorrect.
If the price before consumption tax is and the tax rate is , the final cost on the receipt is
Here, is a positive integer. Depending on , some values of can never occur. If such a value appears on a receipt, that receipt is invalid.
You are given lines of input. Each line contains a positive integer and a nonnegative integer . Here, is the final cost written on the receipt, and is the tax rate at the time the receipt was issued.
The first line contains the number of receipts .
Each of the next lines contains two integers and , separated by a space.
For each receipt, print YES if its final cost is possible for some positive integer price before tax, or NO otherwise, on a separate line.
For each receipt, print YES if its final cost is possible, or NO otherwise, on a separate line.