In a storage, there are magic coins with denominations of , , , , and so on, meaning each coin has a denomination of 3^d for some non-negative integer . The coins can be used in unlimited quantities, including multiple of the same type.
The task is to determine if it is possible to form a sum of using exactly coins.
A total of such queries are provided.
The first line contains one integer (1 \le Q \le 10^5) — the number of queries.
Each of the next lines contains two integers and (1 \le y \le x \le 10^{18}) — the required sum and the number of coins.
For each query, output Yes if it is possible to form the sum using exactly coins, otherwise output No.
Example 1