#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, flag, t1, t2;
  cin >> t;
  while (t--) {
    flag = 0;
    cin >> n;
    vector<int> b(12, 0);
    for (int i = 0; i < n; i++) {
      cin >> t2;
      if (t2 <= 2048) {
        t1 = log2(t2);
        b[t1]++;
      }
    }
    for (int i = 1; i < 12; i++) {
      b[i] += b[i - 1] / 2;
    }
    if (b[11] >= 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
