#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q > 0) {
    int n;
    cin >> n;
    vector<int> a(n);
    map<int, int> cnt;
    map<int, int>::iterator it;
    bool solved = false;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      cnt[a[i]]++;
    }
    for (it = cnt.begin(); it != cnt.end(); it++) {
      int val = 2048 / (*it).first;
      if ((*it).second >= val && val > 0) {
        solved = true;
        break;
      }
      int p = (*it).second / 2;
      if (p != 0) cnt[(*it).first * 2] += p;
    }
    if (!solved)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
    q--;
  }
  return 0;
}
