amit-chahals-love-for-juices-and-dhruv-katyals-astrology_36818
Amit Chahal has a pious love for all kind of fruit juices. Almost every day ,he buys One litre pack of juice. For past one month , Amit Chahal is having a very bad time. One day while he was on a date, he Reverse Peristalsis . Amit Chahal  guessed it is probably due to juices he has been drinking for a while.
Amit Chahal told his problem to Dhruv Katyal (Popularly known as DK). Not many people in NIT are aware of the fact that Dhruv is also an astrologer and an expert in face reading. Dhruv told him that he should be carefull while buying juices. He should only buy those packets whose MRP is a Good Number. Amit Chahal decided to strictly follow the advice of Dhruv because don't want to get embarrassed again when he is on date.
A Good Number is that number whose digits when added together produce a prime number.

Input : First line will contain an integer t, the number of test cases. Description of each test case follow. Each test case consists of only one line telling the MRP of a packet of juice.

Output : For each testcase, print "YES" in a newline if Amit Chahal should buy that juice. "NO" otherwise. Quotes for clarity only.

Constraints :
1 ≤ t ≤ 10
1 ≤ MRP ≤ 10^1000
The price is so huge because it is in the currency of Zimbabwe.

Problem Setter : Abhishek Azad
Problem Tester :Faraz Ghazi

SAMPLE INPUT
3
22
3
7

SAMPLE OUTPUT
NO
YES
YES
def isprime(number):
 if number==2:
  return 1
 if number%2==0: 
  return 0
 N=number**0.5
 i=3
 while i<=N:
  if number%i==0:
   return 0
  i=i+2
 return 1

def main():
 for t in range(input()):
  number=long(raw_input())
  summ=0
  while number>0:
   summ=summ+number%10
   number=number/10
  if isprime(summ)==1:
   print "YES"
  else:
   print "NO"
main()
3
22
3
7

SAMPLE 3
22
5
7

SAMPLE 3
22
9
7

SAMPLE 3
15
17
19

SAMQLE 3
23
17
19

SAMQLE 3
17
16
19

SAMQLE 3
21
16
23

SAMQLE 3
21
16
46

SAMPME 3
38
39
21

TANOLE 3
22
9
7

SAMQLE 3
15
9
7

SAMQLE 3
15
17
7

SAMQLE 3
15
17
10

SAMQLE 3
17
17
19

SAMQLE 3
17
16
23

SAMQLE 3
21
16
23

SAMQME 3
21
16
23

SAMPME 3
21
26
46

SAMPME 3
21
26
46

SAMOME 3
21
26
46

SANOME 3
21
26
51

SANOME 3
21
50
51

SANOME 3
21
50
77

SANOME 3
21
50
57

SANOME 3
21
50
57

TANOME 3
21
65
57

TANOME 3
21
65
27

TANOME 3
20
65
27

TANOME 3
20
65
27

TANOLE 3
20
43
27

TANOLE 3
38
43
27

TANOLE 3
38
43
21

TANOLE 3
38
32
21

TANOLE 3
38
32
21

OANTLE 3
38
32
22

OANTLE 3
38
32
22

OANTLF 3
46
32
22

OANTLF 3
46
34
22

OANTLF 3
46
34
22

OANTFL 3
46
34
33

OANTFL 3
46
34
33

O@NTFL 3
46
34
33

LFTN@O 3
46
27
33

LFTN@O 3
41
27
33

LFTN@O 3
41
27
66

LFTN@O 3
41
45
66

LFTN@O 3
41
45
66

LFNT@O 3
41
45
129

LFNT@O 3
10
45
129

LFNT@O 3
10
45
47

LFNT@O 3
10
87
47

LFNT@O 3
10
103
47

LFNT@O 3
10
79
47

LFNT@O 3
10
79
47

LGNT@O 3
16
79
47

LGNT@O 3
16
79
62

LGNT@O 3
16
79
62

LGOT@O 3
16
79
57

LGOT@O 3
16
19
57

LGOT@O 3
16
19
57

LGNT@O 3
16
19
57

O@TNGL 3
32
19
57

O@TNGL 3
22
3
13

SAMPLE 3
22
5
12

SAMPLE 3
22
5
5

SAMPLE 3
22
9
7

RAMQLE 3
10
9
7

SAMQLE 3
15
17
11

SAMQLE 3
15
17
6

SAMQLE 3
23
17
19

SANQLE 3
5
17
19

SAMQLE 3
17
17
30

SAMQLE 3
15
16
19

SAMQLE 3
17
16
23

SAMLQE 3
21
16
26

SAMQLE 3
21
16
26

SAMQME 3
31
16
23

SAMPME 3
21
16
10

SAMPME 3
21
41
46

SAMPME 3
21
16
46

SAMOME 3
21
26
46

NASOME 3
16
26
51

SANOME 3
21
50
93

SANOME 3
21
50
79

SANOME 3
35
50
57

SANOME 3
27
50
57

TANOME 3
14
65
57

TANOME 3
21
65
27

T@NOME 3
28
65
27

TANOME 3
20
65
27

TAOOLE 3
20
43
51

TANOLE 3
47
43
27

TANOLE 3
38
43
1

TANOLE 3
38
39
21

TANOLF 3
38
41
21

TANOLE 3
38
28
21

OANTLE 3
38
6
22

OANTLE 3
38
32
27

OANTLF 3
46
2
22

OANTLF 3
52
34
22

OANTLF 3
46
34
22

FANTOL
NO
YES
YES NO
YES
YES
 NO
NO
YES
 NO
NO
NO
 YES
NO
NO
 NO
YES
NO
 YES
YES
YES
 YES
YES
NO
 YES
NO
YES
 NO
NO
YES
 NO
NO
YES
 NO
NO
YES
 NO
NO
YES
 NO
NO
NO
 NO
YES
YES
 YES
YES
YES
 YES
YES
YES
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
YES
 YES
YES
YES
 YES
YES
YES
 YES
YES
NO
 YES
YES
NO
 NO
YES
NO
 NO
YES
NO
 NO
YES
NO
 NO
YES
NO
 NO
YES
NO
 NO
YES
NO
 NO
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
YES
 YES
NO
YES
 YES
NO
YES
 YES
NO
YES
 YES
NO
YES
 YES
NO
YES
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 YES
NO
NO
 NO
YES
NO
 NO
YES
YES
 NO
YES
YES
 NO
NO
YES
 YES
NO
YES
 NO
NO
YES
 NO
NO
NO
 YES
NO
NO
 YES
NO
NO
 NO
NO
YES
 NO
YES
NO
 NO
YES
YES
 YES
YES
NO
 YES
YES
NO
 NO
YES
YES
 YES
YES
YES
 YES
YES
NO
 YES
YES
NO
 YES
NO
NO
 YES
NO
NO
 YES
YES
NO
 YES
YES
NO
 NO
YES
NO
 NO
YES
NO
 YES
YES
NO
 YES
YES
NO
 NO
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
NO
 YES
YES
YES
 YES
NO
YES
 YES
YES
YES
 YES
NO
YES
 YES
NO
NO
 YES
YES
NO
 NO
YES
NO
 YES
YES
NO
 NO
YES
NO
