#include <bits/stdc++.h>
using namespace std;
int find_2048(vector<long long> v_val) {
  vector<long> lg;
  int n;
  for (int j = 0; j < 12; j++) {
    lg.push_back(0);
  }
  for (int i = 0; i < v_val.size(); i++) {
    if (v_val[i] <= 2048) {
      lg[log2(v_val[i])]++;
    }
  }
  for (int k = 0; k < 12; k++) {
    if (lg[k] >= 2) {
      lg[k + 1] += lg[k] / 2;
    }
  }
  if (lg[11] > 0) {
    return 0;
  } else {
    return -1;
  }
}
int main() {
  int i = 0;
  int nb;
  int len;
  long long val;
  vector<long long> v_val;
  vector<string> res;
  cin >> nb;
  while (i < nb) {
    int is_done = 0;
    cin >> len;
    for (int j = 0; j < len; j++) {
      cin >> val;
      if (val == 2048 & is_done == 0) res.push_back("YES");
      is_done = 1;
      v_val.push_back(val);
    }
    if (res.size() < i + 1) {
      if (find_2048(v_val) == -1) {
        res.push_back("NO");
      } else {
        res.push_back("YES");
      }
    }
    v_val.clear();
    i++;
  }
  for (int k = 0; k < res.size(); k++) cout << res[k] << endl;
  return 0;
}
