#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int sum = 0;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      if (a <= 2048) sum += a;
    }
    sum >= 2048 ? cout << "YES\n" : cout << "NO\n";
  }
  return 0;
}
