#!/usr/bin/python from collections import defaultdict from fractions import gcd from itertools import chain from Queue import Queue from random import randrange flatten = chain.from_iterable def rabin_miller(p): if p < 2: return False if p != 2 and p % 2 == 0: return False s = p - 1 while s % 2 == 0: s >>= 1 for _ in xrange(10): a = randrange(p-1) + 1 temp = s mod = pow(a, temp, p) while temp != p-1 and mod != 1 and mod != p-1: mod = (mod * mod) % p temp *= 2 if mod != p-1 and temp % 2 == 0: return False return True def pollard(n): if n % 2 == 0: return 2 x = randrange(2, 1000000) c = randrange(2, 1000000) y = x d = 1 while d == 1: x = (x * x + c) % n y = (y * y + c) % n y = (y * y + c) % n d = gcd(x-y, n) if d == n: break return d # Prime Factorization by Pollard Rho alrorithm # http://code.activestate.com/recipes/577037-pollard-rho-prime-factorization/ def factorize(n): que = Queue() res = defaultdict(int) if n == 1: res[1] = 1 return res que.put(n) while not que.empty(): l = que.get() if rabin_miller(l): res[l] += 1 continue d = pollard(l) que.put(d) if d != l: que.put(l / d) return res n = int(raw_input()) factored = factorize(n) arr = map(sum, zip(*factored.items()))[1:] cnt = arr.pop() if arr else 0 print 'YES' if cnt >= 3 else 'NO'