#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here name = 'hackerrank' j = 0 count = 0 for i in s: if j == 10: break elif i == name[j]: j += 1 continue if j == len(name): print 'YES' else: print 'NO'