#include <bits/stdc++.h>
using namespace std;
long long int f() {
  long long int n;
  cin >> n;
  vector<long long int> v;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    if (x <= 2048) {
      v.push_back(x);
    }
  }
  long long int cnt = 0;
  for (long long int i = 0; i < v.size(); i++) {
    cnt += v[i];
  }
  if (cnt >= 2048) {
    cout << "YES" << endl;
    return 0;
  } else if (cnt < 2048) {
    cout << "NO" << endl;
  }
  return 0;
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    f();
  }
  return 0;
}
