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