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