#include <bits/stdc++.h>
using namespace std;
int n, q, s, cntlog2[2050] = {0};
int main() {
  scanf("%d", &q);
  while (q--) {
    memset(cntlog2, 0, sizeof(cntlog2));
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &s);
      if (s <= 2048) cntlog2[s]++;
    }
    for (int i = 1; i < 2048; i++) {
      while (cntlog2[i] >= 2) {
        cntlog2[i] -= 2;
        cntlog2[2 * i]++;
      }
    }
    if (cntlog2[2048]) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
