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(); int h=0,a=0,r=0,c=0,k=0,e=0,n=0; for(int i=0;i=1&a>=2&c>=1&k>=2&e>=1&r>=2&n>=1) { System.out.println("YES"); } else System.out.println("NO"); } } }