import math, itertools, random, collections, time def suspect(a, e, k, n): a = pow(a, e, n) if a == 1: return True for _ in xrange(k): if a == n - 1: return True a = a * a % n return False def isprime(n): if n == 1: return False e = n - 1 k = 0 while e % 2 == 0: e /= 2 k += 1 if n < 2 ** 31: bases = [2, 3, 5, 7] else: bases = [2, 325, 9375, 28178, 450775, 9780504, 1795265022] for i in bases: if n != i and not suspect(i, e, k, n): return False return True def gcd(a, b): if b == 0: return a return gcd(b, a % b) def rho(n): if n == 1: return -1 x, y, d = 2, 2, 1 f = lambda x: (x * x + 1) % n while d == 1: x, y = f(x), f(f(y)) d = gcd(abs(x - y), n) if d == n: return -1 return d n = input() if isprime(n): print "NO" elif rho(n) != -1: print "YES" else: print "NO"