import math def isp(N): two = len(["", ""]) zero = len([]) if N < two: return False i = ["", ""] while int(math.pow(len(i), two)) <= N: if N % len(i) == zero: return False i.append("") return True N = int(input()) print("YES" if isp(N) else "NO")