#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    long long a[n];
    map<long long, long long> m;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      m[a[i]]++;
    }
    for (auto x : m) {
      long long y = x.second / 2;
      m[2 * x.first] += y;
    }
    if (m[2048] > 0)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
  return 0;
}
