#include <bits/stdc++.h>
int main(void) {
  int q, n, in, i, a[12];
  scanf("%d", &q);
  while (q--) {
    for (i = 0; i < 12; i++) a[i] = 0;
    scanf("%d", &n);
    while (n--) {
      scanf("%d", &in);
      if (in <= 2048) {
        if (in == 1)
          a[0]++;
        else if (in == 2)
          a[1]++;
        else if (in == 4)
          a[2]++;
        else if (in == 8)
          a[3]++;
        else if (in == 16)
          a[4]++;
        else if (in == 32)
          a[5]++;
        else if (in == 64)
          a[6]++;
        else if (in == 128)
          a[7]++;
        else if (in == 256)
          a[8]++;
        else if (in == 512)
          a[9]++;
        else if (in == 1024)
          a[10]++;
        else if (in == 2048)
          a[11]++;
      }
    }
    for (i = 1; i < 12; i++) a[i] += (a[i - 1] / 2);
    if (a[11] >= 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
