#!/bin/python3 import sys st="hackerrank" q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here k=0 for i in range(len(s)): if(st[k]==s[i]): k=k+1 if(k==(len(st))): print("YES") else: print("NO")