#include <bits/stdc++.h>
using namespace std;
int main() {
  int m[12] = {};
  for (int i = 0; i < 12; ++i) {
    m[i] = (12 - i);
  }
  int q;
  cin >> q;
  while (q--) {
    int n, x;
    cin >> n;
    int a[32] = {};
    for (int i = 0; i < n; ++i) {
      cin >> x;
      int p = log2(x);
      a[p]++;
    }
    for (int i = 0; i < 11; ++i) {
      a[i + 1] += a[i] / 2;
      (a[i] & 1) ? a[i] = 1 : a[i] = 0;
    }
    bool ans = 0;
    for (int i = 0; i < 12; ++i) {
      if (a[i] >= m[i]) {
        ans = 1;
        cout << "YES\n";
        break;
      }
    }
    if (!ans) cout << "NO\n";
  }
}
