#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    long long num = 0;
    vector<long long> arr;
    cin >> n;
    for (int j = 0; j < n; j++) {
      long long q = 0;
      cin >> q;
      if (q <= 2048) {
        arr.push_back(q);
      }
    }
    for (int j = 0; j < arr.size(); j++) {
      if (arr[j] == 2048) {
        cout << "YES" << endl;
        goto lab;
      }
    }
    sort(arr.begin(), arr.end());
    for (int j = arr.size() - 1; j >= 0; j--) {
      num = arr[j] + num;
      arr.pop_back();
      if (num == 2048) {
        cout << "YES" << endl;
        goto lab;
      }
    }
    cout << "NO" << endl;
  lab:
    int arrrrrrrrr;
  }
}
