#!/bin/python import re import sys """ ms = 'hackerrank' ml = len(ms) mp = 0 """ q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here if re.match('.*h.*a.*c.*k.*e.*r.*r.*a.*n.*k.*', s): print 'YES' else: print 'NO' """ for l in s: if mp < ml and l == ms[mp]: mp += 1 if mp >= ml: print 'YES' break else: print 'NO' """