import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int q = in.nextInt(); for(int a0 = 0; a0 < q; a0++){ String s = in.next().toLowerCase(); int[] ch = new int[26]; for(char i : s.toCharArray()) { ch[((int)i)%97] = ch[((int)i)%97] + 1; } //System.out.println(Arrays.toString(ch)); String qs = "hackerrank"; boolean found = true; for(int j = 0 ; j < qs.length(); j++) { if(ch[((int)qs.charAt(j))%97] == 0) { found = false; break; } } if(found) System.out.println("YES"); else System.out.println("NO"); } } }