#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    vector<long long> v;
    priority_queue<long long, vector<long long>, greater<long long>> p;
    for (int i = 0; i < n; i++) {
      long long x;
      cin >> x;
      v.push_back(x);
      p.push(x);
    }
    sort(v.begin(), v.end());
    bool bol = binary_search(v.begin(), v.end(), 2048);
    bool flag = false;
    if (bol == true) {
      cout << "YES" << endl;
      flag = true;
    }
    if (flag == false) {
      while (p.size() > 1) {
        long long r = p.top();
        p.pop();
        long long k = p.top();
        p.pop();
        if (r == k) {
          if (r + k == 2048) {
            flag = true;
            cout << "YES" << endl;
            break;
          } else
            p.push(r + k);
        } else {
          p.push(k);
        }
      }
    }
    if (flag == false) cout << "NO" << endl;
  }
  return 0;
}
