# coding:utf-8
import numpy as np
import sys
 
s = raw_input().rstrip().split(" ")
i = len(s[1])
x = int(s[0]) * pow(10, i) + int(s[1])
for n in range(2, 1000):
  if x % n == 0:
    print "No"
    sys.exit()
print "Yes"