#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::cout;
using std::ios_base;
using std::unordered_map;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int times, n;
  cin >> times;
  while (times--) {
    cin >> n;
    int f[n];
    unordered_map<int, int> mp;
    for (int i = 0; i < n; i++) cin >> f[i], mp[f[i]]++;
    bool found = 0;
    while (1) {
      bool ok = 0;
      for (auto iter = mp.begin(); iter != mp.end(); iter++) {
        if (iter->first == 2048) {
          found = 1;
          break;
        }
        if (iter->second > 1) {
          mp[iter->first + iter->first]++;
          mp[iter->first] -= 2;
          ok = 1;
          if (iter->first + iter->first == 2048) found = 1;
          break;
        }
      }
      if (!ok or found) break;
    }
    cout << (found ? "YES" : "NO") << "\n";
  }
  return 0;
}
