#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here word = "hackerrank" L = len(word) t = 0 p = 0 while p < len(s) and t < L: if s[p] == word[t]: t += 1 p += 1 if t == L: print "YES" else: print "NO"