import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); PrintWriter pw = new PrintWriter(System.out); for (int z = 0; z < t; z++) { int n = Integer.parseInt(br.readLine()); String[] sa = br.readLine().split(" "); int[] c = new int[3]; for (int i = 0; i < n; i++) { int a = Integer.parseInt(sa[i]); c[a]++; } if (c[0] == 1 && c[2] == 1 && c[1] == n - 2) { pw.println("Yes"); } else { pw.println("No"); } } pw.flush(); br.close(); } }