#K35287. Emirp Number Checker
Emirp Number Checker
Emirp Number Checker
In this problem, you are given a single integer N. Your task is to determine if N is an Emirp number. An Emirp number is defined as a prime number that, when its digits are reversed, becomes a different prime number. Note that if the reversed number is the same as the original (i.e. a palindromic prime), then it is not considered an Emirp.
For example, 13 is an Emirp because its reverse, 31, is also a prime number and 13 ≠ 31. On the other hand, 11 is not an Emirp since its reverse is also 11.
You are required to read the input from standard input (stdin) and print the result to standard output (stdout). If the number is an Emirp, output YES; otherwise, output NO.
inputFormat
The input is provided via standard input (stdin) and consists of a single integer N (0 ≤ N ≤ 10^9).
outputFormat
Print a single line to standard output (stdout) containing the string "YES" if N is an Emirp number, and "NO" otherwise.## sample
13
YES