#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int ara[100], a, b, c, lng, nn = 0, cnt = 0;
    cin >> lng;
    for (a = 0; a < lng; a++) {
      cin >> b;
      if (b <= 2048) {
        ara[nn] = b;
        nn++;
      }
    }
    for (c = 0; c < nn; c++) {
      cnt = cnt + ara[c];
    }
    if (cnt >= 2048)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
