import sys def isprime return YES if len filter lambda xrange else NO

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