#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int ki[100];
    memset(ki, 0, sizeof ki);
    for (int i = 1; i <= n; i++) {
      int a;
      cin >> a;
      if (a > 2048) continue;
      int now = 0;
      while (a > 1) a /= 2, now++;
      ki[now]++;
    }
    for (int i = 1; i <= 30; i++) {
      ki[i] += ki[i - 1] / 2;
    }
    if (ki[11])
      cout << "YES\n";
    else
      cout << "No\n";
  }
}
