Competitions

# Upside down primes

Last night, I must have dropped my alarm clock. When the alarm went off in the morning, it showed 51:80 instead of 08:15. This made me realize that if you rotate a seven segment display like it is used in digital clocks by 180 degrees, some numbers still are numbers after turning them upside down.

Prime number 18115211 on a seven segment display (see third sample).

18115211 turned upside down (i.e. rotated by 180 degrees) gives 11251181, which is not prime.

As you can see,

My favourite numbers are primes, of course. Your job is to check whether a number is a prime and still a prime when turned upside down.

#### Input

One line with the integer n in question (1n1016). n will not have leading zeros.

#### Output

Print one line of output containing "yes" if the number is a prime and still a prime if turned upside down, "no" otherwise.

Time limit 2 seconds
Memory limit 128 MiB
Input example #1
151

Output example #1
yes

Input example #2
23

Output example #2
no

Input example #3
18115211

Output example #3
no

Source 2015 German Collegiate Programming Contest (GCPC), June 20, Problem K