#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): s = input().strip() example_str = "hackerrank" index = 0 for i in s: if index < 10 and i == example_str[index]: index += 1 print("YES") if index == 10 else print("NO")