1827: 【CSP循环】判断质数②█

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:2 Solved:2

Description

质数是指除了 lns="http://www.w3.org/1998/Math/MathML">1 和本身之外没有其他约数的数,如 lns="http://www.w3.org/1998/Math/MathML">7 和 lns="http://www.w3.org/1998/Math/MathML">11 都是质数,而 lns="http://www.w3.org/1998/Math/MathML">6 不是质数,因为 lns="http://www.w3.org/1998/Math/MathML">6 除了约数 lns="http://www.w3.org/1998/Math/MathML">1 和 lns="http://www.w3.org/1998/Math/MathML">6 之外还有约数 lns="http://www.w3.org/1998/Math/MathML">2 和 lns="http://www.w3.org/1998/Math/MathML">3 。

输入一个正整数,判断它是否为质数,如是质数则输出Yes,否则输出这个数的大于 lns="http://www.w3.org/1998/Math/MathML">1 的最小的约数。

Input

仅有一行包含一个正整数 lns="http://www.w3.org/1998/Math/MathML">n,其中 lns="http://www.w3.org/1998/Math/MathML">1<n<1000000

Output

仅有一行,如果从输入文件读入的数是质数则输出Yes,否则输出这个数的大于 lns="http://www.w3.org/1998/Math/MathML">1 的最小的约数。

Sample Input Copy

2009

Sample Output Copy

7