#include <bits/stdc++.h>
using namespace std;
int ans[1024 * 3];
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  int n;
  scanf("%d", &t);
  while (t--) {
    memset(ans, 0, sizeof(ans));
    int x;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &x);
      if (x <= 2048) {
        ans[x]++;
      }
    }
    int y = 1;
    while (y <= 2048) {
      if (ans[y] >= 2) {
        int z = ans[y] / 2;
        ans[y] = ans[y] - z;
        y = y * 2;
        ans[y] = ans[y] + z;
      } else {
        y = y * 2;
      }
    }
    if (ans[2048] >= 1) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
