F. [Purple] Can you find the good number ?
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Essam was observing the night sky when the Moon challenged him with a mathematical puzzle.A positive integer is called good if all of its digits are identical (for example, $$$7$$$, $$$22$$$, and $$$555$$$ are good numbers, while $$$15$$$ and $$$100$$$ are not).The Moon gives Essam a positive integer $$$n$$$.

Essam needs to check if both of the following conditions are true:

  1. $$$n$$$ is a good number;
  2. $$$n \times 1.5$$$ is an integer (has no decimal part) and is also a good number.

Help Essam write a program to answer the Moon's question!

Input

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — denotes the number of test cases.

The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^{18}$$$) — denotes the number Moon wants to multiply by 1.5.

Output

For each test case, output "YES" if $$$n \times 1.5$$$ is a good number, and "NO" otherwise.

You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

Example
Input
5
2
44
3
222
88
Output
YES
YES
NO
YES
NO