#K31. Doubly Prime Numbers
Doubly Prime Numbers
Doubly Prime Numbers
In this problem, you are required to determine whether a given integer ( n ) is a doubly prime number. A number ( n ) is said to be doubly prime if both ( n ) and ( n-2 ) are prime numbers. Recall that a prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, 5 is doubly prime because both 5 and 5-2 = 3 are prime, whereas 11 is not doubly prime because although 11 is prime, 11-2 = 9 is not prime.
inputFormat
The input consists of a single integer ( n ) (( 1 \leq n \leq 10^6 )) provided via standard input.
outputFormat
Output a single string: "yes" if ( n ) is doubly prime, and "no" otherwise. The output should be printed to standard output.## sample
5
yes