PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000006. Lời tiên đoán của Panoramix (Panoramix's Prediction)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Lời tiên đoán của Panoramix (Panoramix's Prediction)

Panoramix's Prediction

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Panoramix has predicted trouble if the Gauls defeat a prime number of Roman soldiers on one day and the next prime number of soldiers the following day. Yesterday they defeated nn soldiers, where nn is prime; today they defeated m>nm>n. Determine whether mm is the smallest prime strictly greater than nn.

Input

One line containing two integers nn and mm, in that order.

Output

Print YES if mm is the next prime after nn; otherwise print NO. Both words must be uppercase.

Subtasks

  • Subtask 1 (20 points): 2≤n<m≤112 \le n < m \le 11; nn is prime.
  • Subtask 2 (30 points): 2≤n<m≤302 \le n < m \le 30; nn is prime.
  • Subtask 3 (50 points): 2≤n<m≤502 \le n < m \le 50; nn is prime.

Examples

Input

3 5

Output

YES

Explanation

The input is n=3n=3 and m=5m=5. The first prime strictly greater than 3 is 5. Thus the answer is YES.

Input

7 11

Output

YES

Explanation

The input is n=7n=7 and m=11m=11. The first prime strictly greater than 7 is 11. Thus the answer is YES.

Input

7 9

Output

NO

Explanation

The input is n=7n=7 and m=9m=9. The first prime strictly greater than 7 is 11. Thus the answer is NO.