#include <bits/stdc++.h>
using namespace std;
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q, n;
  long long x, s = 0;
  cin >> q;
  while (q--) {
    cin >> n;
    s = 0;
    for (int i = 0; i < n; i++) {
      cin >> x;
      if (x <= 2048) {
        if (s < 2048) s = s + x;
      }
    }
    if (s >= 2048)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
