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
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
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 , determine whether every prime divisor of also divides . If , the condition is true because has no prime divisors. The condition does not require to divide ; only each distinct prime divisor of must divide .
Input
One line contains two integers .
Output
Print exactly Yes if the condition holds, and No otherwise.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
120 75
Output
Yes
Explanation
We have and . Both prime divisors and of also divide , so the answer is Yes, even though does not divide .