Edward spends a lot of time learning Japanese in hopes that he can one day actually read his collection of raw light novels. However, Japanese is a hard language. To give himself a confidence boost, he decided to invent a new language called Japaneasy and master that instead.
In short, Japaneasy consists of the following characters with their respective sounds listed below:
k | n | h | m | r | |
---|---|---|---|---|---|
あ a | か ka | な na | は ha | ま ma | ら ra |
い i | き ki | に ni | ひ hi | み mi | り ri |
う u | く ku | ぬ nu | ふ fu | む mu | る ru |
え e | け ke | ね ne | へ he | め me | れ re |
お o | こ ko | の no | ほ ho | も mo | ろ ro |
In particular, note the irregularity of ふ.
He also defines a valid Japaneasy word as a word whose sounds are a sequence of the given sounds. Formally speaking, a string is valid if it can be constructed by continually appending one of the strings (Japaneasy characters) given above to an empty string.
To learn the language efficiently, Edward decides that he needs an app that can check whether given strings are valid Japaneasy. Please help him make it.
Constraints
Each string contains only lowercase characters.
The sum of the lengths of all strings does not exceed .
Input Specification
The first line contains a number , the number of strings.
The next lines each contain one string , the word to be evaluated.
Output Specification
Output lines, the line containing YES
if is a valid Japaneasy word or NO
otherwise.
Sample Input
8
hairu
hairimashita
hu
kakakakakaka
akakakakakak
hiragana
hirakana
asunabestgirl
Sample Output
YES
NO
NO
YES
NO
NO
YES
NO
Explanation
For the first string, hairu
is valid Japaneasy since it consists of the Japaneasy characters ha
, i
, and ru
.
For the second string, it is impossible to make the substring shi
with Japaneasy characters.
For the third string, note that hu
is not a Japaneasy character.
Comments