#!/bin/python import sys q = int(raw_input().strip()) target = "hackerrank" lst = list(target) last_index = len(target) def solve(stt): s = raw_input().strip() # your code goes here cursor = 0 for c in s: if target[cursor] == c: cursor += 1 if cursor == last_index: return True return False for a0 in xrange(q): print "YES" if solve(a0) else "NO"