#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T, N, ele;
  cin >> T;
  while (T--) {
    map<long long, long long> m;
    map<long long, long long>::iterator itr;
    map<long long, long long>::iterator it;
    long long count = 0, n;
    cin >> N;
    for (int i = 0; i < N; i++) {
      cin >> ele;
      if (m.find(ele) == m.end()) {
        m.insert({ele, 1});
      } else {
        m[ele]++;
      }
    }
    if (m.find(2048) != m.end()) {
      cout << "YES" << endl;
      continue;
    }
    for (itr = m.begin(); itr != m.end(); itr++) {
      if (itr->second >= 2) {
        it = m.find(2 * (itr->first));
        n = (itr->second) / 2;
        if (it == m.end()) {
          m.insert({2 * (itr->first), n});
        } else {
          it->second = it->second + n;
        }
        itr->second = itr->second - n;
      }
      if (itr->first == 2048) {
        cout << "YES" << endl;
        count = 1;
      }
    }
    if (count == 0) {
      cout << "NO" << endl;
    }
  }
}
