Spotting Spies

3.7

7 votes
Easy
Problem

Ant nests have spider spies robbing info and food. Queen Ant knows the total leg-count N in each of these nests. Help queen ant find out if spiders can be present in each nest or not.

Note that ants have 6 legs and spiders have 8.

Input Format:

First line contains T, number of nests. Each of the next T lines contain a single integer N denoting the leg count that the Queen Ant obtained for each nest.

Output Format:

Print T lines, i'th line is the answer for the i'th nest. Print "YES" if it is possible, "NO" if it is not possible and "NA" if this leg-count can never be obtained.

Constraints:

1 ≤ T ≤ 5

1 ≤ N ≤ 2000

Sample Input
5
17
6
8
42
1080
Sample Output
NA
NO
YES
YES
YES
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Fourth Case: Ant colony can have 7 ants with 42 leg count. But question asks if it is possible to have spiders in the colony and still have this leg-count. There is a possibility of ants & spiders both having a count of 3 which also has the same leg count.

Editor Image

?