2420. Hidden Prime Number

单点时限: 3.0 sec

内存限制: 256 MB

Little Johnny, a boy 11 years old, is asked by his friend about a riddle in a popular role playing game ‘Neverending Fantasy XIV’. The riddle is to check whether the greatest common divisor of given two integers $x$ and $y$ are a prime number. In this game, such prime number is called hidden prime number. If he solve this riddle, he can change his character’s class to “Mathematician.” However, Johnny doesn’t know how to solve this riddle because his brother helps him. Your job is to write a program to solve this riddle and help Johnny.

输入格式

Input consists of multiple test cases. Input consists of multiple test cases. Each test case contains two positive integer $x$ and $y$ ($1 < x, y \le 2^{32}$). Input is terminated by a case of $x = y = 0$, and it should not be processed.

输出格式

For each test case, you should output “Yes” if there is a hidden prime number. Otherwise, output “No”.

样例

Input
4 8
3 15
0 0
Output
No
Yes

4 人解决,12 人已尝试。

5 份提交通过,共有 52 份提交。

8.8 EMB 奖励。

创建: 11 年,10 月前.

修改: 2 年,8 月前.

最后提交: 6 月,4 周前.

来源: Winter Contest 2008

题目标签