M, D = map(int, input().split()) N = M * 100 + D print("Yes" if all(N % i != 0 for i in range(2, N)) else "No")