Twisted Prime Number
Submissions: 1655   Accuracy:

34.38%

  Difficulty: Basic   Marks: 1

A number is said to be twisted prime if it is a prime number and reverse of the number is also a prime number.

Input:
The first line of input contains an integer T denoting the number of test cases. The first and last line of each test case consists of an integer n.  

Output:
Print the answer in "Yes" or "No".

Constraints: 
1<=T<=100
2<=n<=100000

Example:
Input:

2
97
43

Output:
Yes
No

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.