#include <bits/stdc++.h>
using namespace std;
map<long long int, int> mp;
void ins(long long int a) {
  if (mp.find(a) == mp.end() || mp[a] == 0) {
    mp[a] = 1;
  } else if (mp[a] == 1) {
    ins(a * 2);
    mp[a] = 0;
  }
}
void solve() {
  mp.clear();
  long long int n, a;
  cin >> n;
  for (auto i = 0; i < n; ++i) {
    cin >> a;
    ins(a);
  }
  if (mp.find(2048) == mp.end())
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
