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

#GL0000338. Giấc mơ tự do (Dreaming of Freedom)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Giấc mơ tự do (Dreaming of Freedom)

Dreaming of Freedom

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn programmers and initially mm algorithms. In each round, every programmer votes for exactly one remaining algorithm. Only algorithms receiving the maximum number of votes survive. The process ends when exactly one algorithm remains.

Determine whether the process is guaranteed to terminate after finitely many rounds for every possible voting pattern. If a tie among multiple options can persist forever, output NO.

Each PHOJ input file contains one pair n,mn,m (no initial test count).

Input

One line containing integers n,mn,m.

Output

Print YES if termination at a single choice is guaranteed, and NO otherwise.

Subtasks

  • Subtask 1 (20 points): 1≤n,m≤10001\le n,m\le1000.

  • Subtask 2 (30 points): 1≤n,m≤1051\le n,m\le10^5.

  • Subtask 3 (50 points): 1≤n,m≤1061\le n,m\le10^6.

Examples

Example 1

Input

3 2

Output

YES

Explanation

Because the smallest prime divisor of 3 exceeds 2, a lasting tie among several options is impossible.

Example 2

Input

4 2

Output

NO

Explanation

Two options can receive two votes each, so the tie can persist forever.

Example 3

Input

1 1000000

Output

YES

Explanation

With a single voter, exactly one option wins each round.