#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, sum, n, s;
  cin >> q;
  for (int i = 0; i < q; i++) {
    sum = 0;
    cin >> n;
    for (int j = 0; j < n; j++) {
      cin >> s;
      if (s <= 2048) {
        sum += s;
      }
    }
    if (sum >= 2048)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
