import sys def isprime return YES if not any for in xrange else NO for

1
2
3
4
5
6
7
8
import sys
def isprime(n):
return 'YES' if not any(n%k==0 for k in xrange(2,n)) else 'NO'
m = []
for i in xrange(input()):
z = sys.stdin.readline()
m.append(int(z))
print '\n'.join(map(isprime, m))