文理学院程序设计在线练习


How much is 1000 minus 7?

Time Limit: 1 Second(s)    Memory Limit: 32 MB

Total Submission(s): 170   Accepted Submission(s): 38
Problem Description

Kaneki has been caught by the enemy and been engaged in more elaborate torture.In the meanwhile,Kaneki was asked to count numbers to stay awake.Count off from 1000 and minus 7 constantly.
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市赛