#include <bits/stdc++.h>
const long long int mod = 1e9 + 7;
using namespace std;
bool prime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t, n, i, d;
  cin >> t;
  while (t--) {
    cin >> n;
    long long int a;
    map<long long int, long long int> mpp;
    long long int flag = 0;
    for (i = 0; i < n; i++) {
      cin >> a;
      mpp[a]++;
    }
    for (auto x : mpp) {
      if (1 <= mpp[2048]) {
        flag = 1;
      }
      if (x.first != 2048) {
        if (x.second > 1) {
          d = x.second / 2;
          mpp[x.first] -= d * 2;
          mpp[x.first * 2] += d;
        }
      }
    }
    if (flag == 1)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
