#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() s = ''.join( c for c in s if c not in 'bdfgijlmopqstuvwxyz') p = 0 h = 'hackerrank' for x in s: if h[p] == x: p+=1 if p == len(h): break print 'YES' if p == len(h) else 'NO'