from operator import sub,add,floordiv,mul import sys N=int(input()) t=floordiv(N,N) u=sub(ord("i"),ord("A")) s=add(t,t) if N==t: print("NO") sys.exit() if N==s: print("YES") sys.exit() i=s while mul(i,i)<=N: if pow(N,t,i)==t: print("NO") break i+=t else: print("YES")