#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n;
    map<long long, long long> frq;
    for (int i = 0; i < n; i++) {
      cin >> x;
      frq[x]++;
    }
    for (int i = 0; i < 11; i++) {
      frq[pow(2, i + 1)] += (frq[pow(2, i)] / 2);
    }
    if (frq[2048]) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
      continue;
    };
  }
  return 0;
}
