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