#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, s, a;
  cin >> q;
  while (q--) {
    a = 0;
    cin >> n;
    while (n--) {
      cin >> s;
      if (s <= 2048) a += s;
    }
    cout << (a >= 2048 ? "\nYES" : "\nNO");
  }
  return 0;
}
