#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const long long NINF = -INF;
const long long MAXN = 1e+6 + 8;
int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};
long long t = 1;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
;
long long n, a[200000];
void MAIN() {
  cin >> n;
  map<long long, long long> cnt;
  for (long long i = (0); i <= (n - 1); i++) cin >> a[i], cnt[a[i]]++;
  long long i = 2048, sum = 0;
  while (i > 0) {
    sum += (i * cnt[i]);
    if (sum >= 2048) {
      cout << "YES\n";
      goto tim;
    }
    i >>= 1;
  }
  cout << "NO\n";
tim:;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> t;
  while (t--) {
    MAIN();
  }
}
