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

#SP0000089. Kiểm tra chia hết cho mọi ước nguyên tố (Chef and Prime Divisors)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Kiểm tra chia hết cho mọi ước nguyên tố (Chef and Prime Divisors)

Chef and Prime Divisors

Source: CodeChef

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integers A,BA,B, determine whether every prime divisor of BB also divides AA. If B=1B=1, the condition is true because 11 has no prime divisors. The condition does not require BB to divide AA; only each distinct prime divisor of BB must divide AA.

Input

One line contains two integers A,BA,B.

Output

Print exactly Yes if the condition holds, and No otherwise.

Subtasks

  • Subtask 1 (20 points): 1≤A≤10000000000000000001\le A\le 1000000000000000000; 1≤B≤100000001\le B\le 10000000.
  • Subtask 2 (30 points): 1≤A≤100000001\le A\le 10000000; 1≤B≤10000000000000000001\le B\le 1000000000000000000.
  • Subtask 3 (50 points): 1≤A≤10000000000000000001\le A\le 1000000000000000000; 1≤B≤10000000000000000001\le B\le 1000000000000000000.

Examples

Input

120 75

Output

Yes

Explanation

We have 120=23⋅3⋅5120=2^3\cdot3\cdot5 and 75=3⋅5275=3\cdot5^2. Both prime divisors 33 and 55 of 7575 also divide 120120, so the answer is Yes, even though 7575 does not divide 120120.