#!/bin/python3 import sys q = int(input().strip()) word = "hackerrank" for a0 in range(q): s = input().strip() counter = 0 for i in s: if (counter >= len(word)): break; if (i == word[counter]): counter += 1 if (counter >= len(word)): print("YES") else: print("NO")