#include <bits/stdc++.h>
int main() {
  short int q;
  scanf("%hi", &q);
  while (q--) {
    short int n;
    scanf("%hi", &n);
    short int Cnt[2049] = {0};
    for (short int i = 0; i < n; i++) {
      int a;
      scanf("%i", &a);
      if (a < 2049) Cnt[a]++;
    }
    for (short int i = 1; i < 1025; i *= 2) {
      Cnt[i * 2] += Cnt[i] / 2;
    }
    if (Cnt[2048])
      printf("Yes\n");
    else
      printf("NO\n");
  }
}
