NSUJ02A - Prime Time

Maria really loves prime times. In her definition, a time is called prime time, if both numbers in hour and minute are primes. For example 07:11 is a prime time, since both of them are prime numbers, but 04:17 or 07:09 are not prime time.

You decided to write a bot that will call her in prime times, now you have to write a program that can understand if a time is a prime time or not.

Input

First number in the input is t, number of test cases.
After that t lines will follow each with a time in hh:mm format, where hh will mean the hour and mm will mean the minute. hh will be an integer within 0 to 23, and mm will be an integer within 0 to 59.

Output

Print "Yes" (without quotes) if it's a prime time, "No" (without quotes) if it's not.

Example

Input:
3
07:11
04:17
07:09 Output: Yes
No
No

Added by:Iqram Mahmud
Date:2011-07-03
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own

hide comments
2014-07-01 06:46:50 Mitch Schwartz
"My code is working perfectly, except for the fact that it crashes at runtime."
2014-07-01 06:16:21 Yosra
My code is working perfectly. But, I didn't know why i got RTE!!!
2013-12-18 02:49:21 Samil Vargas
man primes are 2 3 5 7 11 13 17 just can be divided by 1 and itself
2011-12-07 08:22:02 Sourabh Singh
getting wa
primes are 2 3 5 ..
or 1 2 3 5 ...
or 0 1 2 3 5 ....
someone got ac plzz.. tell
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.