#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> mp;
  map<int, int>::iterator it;
  int tc, n, i, x;
  cin >> tc;
  while (tc--) {
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> x;
      if (x < 4096) mp[x]++;
    }
    if (mp[2048] > 0) {
      cout << "YES" << endl;
      mp.clear();
      continue;
    }
    int flag = 0;
    for (it = mp.begin(); it != mp.end(); it++) {
      if (it->first * (it->second / 2) * 2 >= 2048) {
        flag = 1;
        cout << "YES" << endl;
        break;
      }
      mp[it->first * 2] += it->second / 2;
    }
    if (!flag) cout << "NO" << endl;
    mp.clear();
  }
  return 0;
}
