import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if (N == BigInteger.ONE.intValue()) {
			System.out.println("NO");
			return;
		}
		for (int i = BigInteger.ONE.add(BigInteger.ONE).intValue(); i < N; i = BigInteger.valueOf(i).add(BigInteger.ONE)
				.intValue()) {
			if (N % i == BigInteger.ZERO.intValue()) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}