#include <bits/stdc++.h>
int main(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    int i, j, a[110];
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    int b[15];
    memset(b, 0, sizeof(b));
    for (i = 0; i < n; i++) {
      for (j = 0; j < 12; j++)
        if (a[i] == pow(2, j)) b[j]++;
    }
    for (j = 0; j < 11; j++) {
      while (b[j] >= 2) {
        b[j] = b[j] - 2;
        b[j + 1] = b[j + 1] + 1;
      }
    }
    if (b[11] >= 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
