#include <bits/stdc++.h>
using namespace std;
int main() {
  int result[100];
  int queryNum;
  int elementNum;
  int flag = 0;
  int temp = 0;
  int sum = 0;
  int i, j;
  cin >> queryNum;
  for (i = 0; i < queryNum; i++) {
    cin >> elementNum;
    for (j = 0; j < elementNum; j++) {
      cin >> temp;
      sum += temp;
      if (sum & (1 << 11)) {
        flag = 1;
      }
    }
    result[i] = flag;
    sum = 0;
    flag = 0;
  }
  for (i = 0; i < queryNum; i++) {
    cout << (result[i] ? "YES" : "NO") << endl;
  }
  return 0;
}
