#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, ipt;
  int a[15];
  cin >> t;
  while (t--) {
    memset(a, 0, sizeof(a));
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> ipt;
      a[int(min(log2(ipt), 12.0))]++;
    }
    for (int i = 0; i < 11; i++) {
      a[i + 1] += a[i] / 2;
    }
    if (a[11] > 0)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
}
