#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    long long int flag = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 2048) {
        flag = 1;
      }
    }
    long long int sum = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] > 2048) {
        continue;
      } else {
        sum += a[i];
      }
    }
    if (flag == 1 || sum >= 2048) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
