#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    long long int i, n, mul, c;
    cin >> n;
    int num[30], x;
    memset(num, 0, sizeof(num));
    for (i = 0; i < n; ++i) {
      cin >> x;
      c = -1;
      while (x) {
        x = x / 2;
        c++;
      }
      num[c]++;
    }
    for (i = 0; i < 11; ++i) {
      num[i + 1] += num[i] / 2;
    }
    if (num[11] == 0) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
