#include <bits/stdc++.h>
using namespace std;
int sq(int a) {
  int cnt1 = 0;
  while (a != 1) {
    cnt1++;
    a /= 2;
  }
  return cnt1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int c = 1;
  for (int q = 0; q < n; q++) {
    int m;
    int r;
    cin >> m;
    int cnt[29];
    for (int i = 0; i < 29; i++) {
      cnt[i] = 0;
    }
    for (int i = 0; i < m; i++) {
      cin >> r;
      cnt[sq(r)]++;
    }
    for (int i = 0; i < 13; i++) {
      cnt[i + 1] = cnt[i + 1] + cnt[i] / 2;
      if (cnt[11] > 0) {
        break;
      }
    }
    if (cnt[11] > 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
