from sympy import isprime print("YES" if isprime(int(input())) else "NO")