Peculiar Times

After finally exchanging phone numbers with Xoranna - spoilers ;-) -, Xorin was eager to set up their first date.

So he patiently waited for her call. However, Xorin decided to only answer calls made at times which could be considered peculiar, because he was convinced that such a correlation meant that Xoranna loved (Accepted) him. A time is expressed as a 5-character string (XY:ZT, where XY denotes the hour, and ZT - the minutes), and is considered peculiar if any of the following criteria holds:

  • It is an exact hour: ZT == "00" (e.g. 12:00)
  • It is a doubled time: XY == ZT (e.g. 12:12)
  • It is a mirror time: XY == TZ (e.g. 12:21)
  • It has increasing consecutive digits (e.g. 01:23, 23:45)
  • After removing the separating ":", the remaining 4-digit number is a power of two with no leading zeros (e.g. 10:24, 20:48)

Moreover, it is guaranteed that X, Y, Z, and T will be contained by "0123456789", but not that the time they form is valid. Only valid times can be considered peculiar:

  • 00 ≤ XY < 24
  • 00 ≤ ZT < 60

Note: you will receive full feedback for this problem.

Input

The first line of the input will hold an integer n <= 50, describing the number of calls Xorin received.
The following n lines contain the time of one call each, in the format established above.

Output

For each call, you should output on n separate lines, either "YES" - in case the respective call was made at a peculiar time - or "NO" - on the contrary. You should not output the quotation marks.

Samples

InputOutput
5
12:34
00:00
00:01
10:10
91:19
YES
YES
NO
YES
NO
Questions?

Sponsors Gold