def factor(x): i = 2 while i * i < x: if x % i == 0: return i i += 1 return -1 N = input() p = factor(N) if p < 0: print('NO') quit() p = factor(N) if p < 0: print('NO') quit() print('YES')