#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  for (long long i = 0; i < 14; i++) {
    mp[(1 << (i + 1))] += mp[(1 << i)] / 2;
  }
  if (mp[2048] > 0) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
