#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    map<long long int, long long int> cnt;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      cnt[a[i]]++;
    }
    if (cnt[2048] > 0) {
      cout << "YES" << endl;
      continue;
    }
    map<long long int, long long int>::iterator it;
    for (it = cnt.begin(); it != cnt.end(); it++) {
      long long int topass = it->second / 2;
      cnt[it->first * 2] += topass;
    }
    if (cnt[2048] > 0) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
