BETA

Difficulty Level: Basic

Submissions: 1010 Accuracy:

28.91%

Twisted Prime Number
     

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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