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
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
To learn the language efficiently, Edward decides that he needs an app that can check whether
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 next
Output Specification
Output YES
if 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