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