# I hate Math N=int(raw_input()) upperbound=10000001 isOKsize=(upperbound-3)/2+1 isOK=[True for i in range(isOKsize)] for i in range(isOKsize): if (i+i+3)*i+i > isOKsize: break if isOK[i]: #i+i+3 is prime p=i+i+3 #delete j s.t. j+j+3 = (2i+3)^2 = 4i^2+12i+9 => j=2i^2+6i+3=p*(i+1)+i #next j is j+j+3 = (2i+3)(2i+5). that is, step of j is 2i+3=p for k in range( p*i+p+i, isOKsize, p): isOK[k]=False primes = [2] + [i+i+3 for i in range(isOKsize) if isOK[i]] cnt = 0 for p in primes: #print p if p*p > N: break while cnt<2 and N%p==0: cnt+=1 N/=p if cnt >= 2: break if cnt>=2: print "YES" else: print"NO"