#include <bits/stdc++.h>
int main() {
  int x, i, j, t, s = 0, c, k, count = 0;
  scanf("%d", &c);
  for (k = 0; k < c; k++) {
    scanf("%d", &x);
    int a[x];
    for (i = 0; i < x; i++) {
      scanf("%d", &a[i]);
    }
    for (i = 0; i < x - 1; i++) {
      for (j = i + 1; j < x; j++) {
        if (a[i] < a[j]) {
          t = a[i];
          a[i] = a[j];
          a[j] = t;
        }
      }
    }
    for (i = 0; i < x; i++) {
      if (a[i] <= 2048) {
        s = s + a[i];
        if (s == 2048) {
          count++;
        }
      }
    }
    if (count == 0) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
    count = 0;
    s = 0;
  }
}
