#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here word = 'hackerrank' store = {i:None for i in range(len(word))} w = 0 success = False for i in range(len(s)): if word[w] == s[i]: w += 1 if w == len(word): success = True break if success: print 'YES' else: print 'NO'