#include <bits/stdc++.h>
using namespace std;
int bit(int x) {
  int i = 0, ans = 1;
  while (ans != x) {
    i++;
    ans *= 2;
  }
  return i;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(12, 0);
    for (int i = 0; i < n; i++) {
      int temp;
      cin >> temp;
      if (temp <= 2048) v[bit(temp)]++;
    }
    for (int i = 0; i < 11; i++) v[i + 1] += v[i] / 2;
    if (v[11])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
