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