m, d = list(map(int, input().split())) a = m * 100 + d f = 1 for b in range(2, a): if not a % b: f = 0 print("Yes" if f else "No")