#!/bin/python3 import sys q = int(input().strip()) dic_check = {} for a0 in range(q): s = input().strip() # your code goes here dic = {'h':1, 'a':2,'c':1,'k':2,'e':1,'r':2,'n':1} for word in s: if word in dic: if dic[word] != 0: dic[word] -= 1 else: dic[word] = 0 x = 0 for d in dic: if dic[d] != 0: print('NO') x = 1 break if x == 0: print('YES')