#include <bits/stdc++.h>
using namespace std;
long long n;
void solve() {
  cin >> n;
  priority_queue<long long, vector<long long>, greater<long long>> pq;
  for (long long i = 0; i < n; i++) {
    long long first;
    cin >> first;
    pq.push(first);
  }
  while (!pq.empty()) {
    long long d = pq.top();
    pq.pop();
    if (d == 2048) {
      cout << "Yes" << '\n';
      return;
    }
    if (pq.empty()) break;
    long long dd = pq.top();
    pq.pop();
    if (dd == 2048) {
      cout << "Yes" << '\n';
      return;
    }
    if (d == dd)
      pq.push(d + dd);
    else
      pq.push(dd);
  }
  cout << "No" << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
