#include <bits/stdc++.h>
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
void shoot() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  shoot();
  long long q;
  cin >> q;
  while (q--) {
    long long i, n;
    cin >> n;
    long long a[n], b[12];
    memset(b, 0, sizeof(b));
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 1) b[0]++;
      if (a[i] == 2) b[1]++;
      if (a[i] == 4) b[2]++;
      if (a[i] == 8) b[3]++;
      if (a[i] == 16) b[4]++;
      if (a[i] == 32) b[5]++;
      if (a[i] == 64) b[6]++;
      if (a[i] == 128) b[7]++;
      if (a[i] == 256) b[8]++;
      if (a[i] == 512) b[9]++;
      if (a[i] == 1024) b[10]++;
      if (a[i] == 2048) b[11]++;
    }
    bool ok = false;
    for (i = 0; i < 11; i++) {
      b[i + 1] += b[i] / 2;
      if (b[i] * (1LL << i) >= 2048) ok = true;
    }
    if (b[11] > 0) ok = true;
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
