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