#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    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];
      if (a[i] <= 2048) {
        mp[a[i]]++;
      }
      for (long long i = 1; i <= 1024; i *= 2) {
        mp[i * 2] += (mp[i] / 2);
        mp[i] %= 2;
      }
    }
    if (mp[2048] > 0) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
  return 0;
}
