import math n=int(input()) a=0 for i in range(2,n): if n % i ==0: a += 1 break if n==1 or a > 0: print("NO") else: print("YES")