m, d = map(int, input().split()) x = 100 * m + d print('Yes' if all(x % i for i in range(2, x)) else 'No')