using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {

    static void Main(String[] args) {
        int q = Convert.ToInt32(Console.ReadLine());
        string str = "knarrekcah";

        for(int a0 = 0; a0 < q; a0++){
            string s = Console.ReadLine();
            
            int counter = 0;
            int i = 0;
            // your code goes here
            while(s.Length > 0){
                if(s[s.Length - 1] == str[i]){
                    counter++;
                    i++;
                }
                
                s = s.Substring(0, s.Length - 1);
            }
            
            if(counter == str.Length){
                Console.WriteLine("YES");
            }
            else {
                Console.WriteLine("NO");
            }
        }
    }
}