Problem: You are given a pair of integers and an integer .
You can change the pair in two different ways:
- set (assign) ;
- set (assign) ,
The pair is called -magic if is obtainable either as or as using only the given operations (i.e. the pair is -magic if or after some number of operations applied). You can apply the operations any number of times (even zero).
Your task is to find out if the pair is -magic or not.
You have to answer independent test cases.
Input Format: The first line of the input contains one integer () — the number of test cases. The next lines describe test cases.
The only line of the test case contains three integers , and ().
Output Format: For the -th test case, print YES if the corresponding pair is -magic and NO otherwise.