import math def is_prime(x): if x < 2: return False if x == 2 or x == 3 or x == 5: return True if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False prime_number = 7 difference = 4 while prime_number <= math.sqrt(x): if x % prime_number == 0: return False prime_number += difference difference = 6 - difference return True p, k = map(int, input().split()) if not (is_prime(p)) or not (2 <= p <= 10 ** 6) or not (0 <= k <= p - 1): print(BufferError) else: print("NO")