n = input() isPrime = True for i in xrange(2,100000000000000): if n % i == 0: isPrime = False break if isPrime: print "YES" else: print "NO"