#include <bits/stdc++.h>
using namespace std;
vector<long long int> yoyo;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int k;
    cin >> k;
    for (int i = 0; i < k; i++) {
      int m;
      cin >> m;
      yoyo.push_back(m);
    }
    sort(yoyo.begin(), yoyo.end());
    long long int countt = 0;
    for (int i = 0; i < k; i++) {
      if (yoyo[i] <= 2048) countt += yoyo[i];
    }
    if (countt >= 2048)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    yoyo.clear();
  }
}
