#Lutece2706. Little Rabbit Numbers
Little Rabbit Numbers
Migrated from Lutece 2706 Little Rabbit Numbers
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
A Fermat number is a positive integer of the form
where is a non-negative integer. The first few Fermat numbers are:
Fermat numbers were first studied by Pierre de Fermat, who conjectured that all Fermat numbers are prime in 1640. As we know, the prime numbers are the natural numbers greater than that have no divisors but and themselves. Indeed, the first five Fermat numbers are easily shown to be prime. But in 1732, Leonhard Euler refuted Fermat's conjecture, since he showed that . Although Fermat's conjecture is not correct, the primality of Fermat numbers is still a topic worth studying.
Little Rabbit, who has a great interest in math, conducts an in-depth study of Fermat numbers. After that, he creates Little Rabbit numbers, which is a positive integer of the form
where is the Fermat number. The function means the largest prime which is strictly less than . For example, , and . And we use to indicate the largest integer that does not exceed .
Little Rabbit is curious about the primality of Little Rabbit numbers. Now given , can you tell him whether is prime?
Input
An integer ().
Output
If is prime, output . Otherwise, output .
Samples
0
YES
1
NO
Note
For the first example, $L_0=\left\lfloor\dfrac{F_0+f(F_0)}{2}\right\rfloor=\left\lfloor\dfrac{3+2}{2}\right\rfloor=2$ is a prime number.
For the second example, $L_1=\left\lfloor\dfrac{F_1+f(F_1)}{2}\right\rfloor=\left\lfloor\dfrac{5+3}{2}\right\rfloor=4$ is not a prime number.
Resources
电子科技大学第十二届 ACM 趣味程序设计竞赛