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