#include <bits/stdc++.h>
long long exp(long long x, long long y, long long p) {
  long long res = 1;
  while (y) {
    if (y % 2) res = (res * x % p) % p;
    x = (x * x) % p;
    y /= 2;
  }
  return res;
}
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long sum = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] <= 2048) {
        sum += a[i];
      }
    }
    if (sum >= 2048)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
