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

#GL0000021. Chọn tổng có phần dư yêu cầu (Choose Integers)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Chọn tổng có phần dư yêu cầu (Choose Integers)

Choose Integers

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Choose one or more positive multiples of AA with no limit on their number or magnitude. Determine whether their sum can have remainder CC when divided by BB.

Input

One line containing A,B,CA,B,C.

Output

Print YES if possible, otherwise NO.

Subtasks

  • Subtask 1 (20 points): 1≤A,B≤101 \le A,B \le 10; 0≤C<B0 \le C < B
  • Subtask 2 (30 points): 1≤A,B≤501 \le A,B \le 50; 0≤C<B0 \le C < B
  • Subtask 3 (50 points): 1≤A,B≤1001 \le A,B \le 100; 0≤C<B0 \le C < B

Examples

Input

7 5 1

Output

YES

Explanation

Choose multiples 77 and 1414. Their sum is 2121, whose remainder modulo 55 is 11.