Rickty Dimensions

3

2 votes
Problem

Rick of dimension C-137 Rick is a grumpy, sociopathic, emotionally unstable, bad-tempered, dismissive, narcissistic, cynical, self-centered, destructive, incredibly intelligent, alcoholic, self-loathing, rude and crude mad scientist, is on a killing spree. He wants to kill every other Rick whose dimension number is a Schwifty number.


A number N is a Schwifty number when converted to English words the number is lexicographically sorted in non-descending order.


Rick is busy with adventures. It is your job to find Schwifty Numbers.

Input

  • The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.

  • The first and only line of each test case contains a single integer N.

Output

For each test case, print a single line containing the string "YES" if it is a Schwifty Number possible or "NO" if it is impossible, (without quotes).

Constraints

1T2×105

1N10100

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?