#include <bits/stdc++.h>
using namespace std;
int q, n;
int a[1000000];
map<int, int> b;
bool dfs(int u, int p, int c) {
  if (u == 0) return 0;
  if (b[u] >= c * p / u) {
    b[u] -= (c * p / u);
    return 1;
  } else {
    int temp = b[u];
    b[u] = 0;
    return dfs(u / 2, u, c * p / u - temp);
  }
}
int main() {
  cin >> q;
  while (q--) {
    memset(a, 0, sizeof(a));
    b.clear();
    cin >> n;
    int k = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      b[a[i]]++;
      if (a[i] == 2048) k = 1;
    }
    if (k) {
      printf("YES\n");
      continue;
    } else {
      int f = dfs(2048, 2048, 1);
      if (f)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
