#!/bin/python3 import sys word="hackerrank" def ch(s): i = 0 for c in s: if c==word[i]: i+=1 if i==len(word): return "YES" return "NO" q = int(input().strip()) for a0 in range(q): s = input().strip() print(ch(s))