def main(): N = int(input()) if N == 1 : print ("NO") return for i in range(2,N-1): if N % i == 0: print("NO") return print("YES","") if __name__ == "__main__": main()