NAtural DIAlogue team at Orange labs has an abbreviation "Nadia Team".
This abbreviation causes a big problem for them in Egypt as a lot of Egyptians think this team is owned by a female called nadia and they don't know they are working on NAtural DIAlogue.
To solve their problem they put their name encrypted on the articles and forgot how to decrypt their name.
The encryption was done by putting nadia characters on the article scattered and they will consider an article related to them if they can delete as many characters as they need to form word "nadia".
Can you write a program to help them to check if the given article belongs to them or not?
The first line contains an integer T, the number of test cases. Followed by T lines, each line contains a test case which consists of a string representing the article, which may contain the word "nadia" typed. This line consists of small Latin letters, and its length is not less than 1 and not more than 100 letters.
For each test case, print a single line containing "YES" if you can delete 0 or more characters to get the string "nadia" (without rearranging the remaining characters), otherwise print "NO".
3 anhaldillooa nnaaddiiaa nxzdiao
YES YES NO