/** * Apr 16, 2016 7:02:06 PM * PrjName: Bc80-01 * @semprathlon */ import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException{ InputReader in=new InputReader(System.in); PrintWriter out=new PrintWriter(System.out); int T=in.nextInt(); while(T-->0){ int n=in.nextInt(); boolean ans1=false,ans2=false; for(int i=1;i<=n;i++){ int k=in.nextInt(); if (k==0) ans1=true; if (k==1) ans2=true; } out.println(ans1&&ans2?"YES":"NO"); } out.flush(); out.close(); } } class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public boolean hasNext() { return tokenizer != null && tokenizer.hasMoreTokens() || nextLine() != null; } public String nextLine() { String tmp = null; try { tmp = reader.readLine(); tokenizer = new StringTokenizer(tmp); } catch (IOException e) { throw new RuntimeException(e); } catch (NullPointerException e) { return null; } return tmp; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } }