**Problem Description**

Please check the number of Kaneki quoted is eligible or not, namely is minus 7 continuously since 1000 like 993,986,979....

**Input**

The first line is the number of test cases T（T<=1000）.

Each test case has one line containing one integer N,which Kaneki counts this time.

**Output**

For each test case, if the number is eligible, please output "YES". Otherwise, please output "NO".

**Sample Input**

4 993 986 980 1000

**Sample Output**

YES YES NO NO

**Source**

2014市赛