#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O2")
#pragma GCC optimization("unrolled-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long base = 1e9 + 7;
const long long oo = 100 + 10;
const long long gh = 1e3 + 3;
const long long inf = 1e15 + 5;
long long n, m, k, q;
long long a[oo];
long long cnt[oo];
void input() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
}
void cre() { sort(a + 1, a + n + 1); }
void solve() {
  cre();
  long long cnt = 0;
  long long t = 1;
  long long i = 1;
  while (t <= 2048) {
    while (a[i] == t) {
      cnt++;
      i++;
    }
    if (t == 2048 && cnt) {
      cout << "YES\n";
      return;
    }
    cnt /= 2;
    t *= 2;
  }
  cout << "NO\n";
}
void ouput() {}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (ifstream("test.txt")) {
    freopen("test.txt", "r", stdin);
  } else if (ifstream(""
                      ".inp")) {
    freopen(
        ""
        ".inp",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  long long t = 1;
  cin >> t;
  while (t--) {
    input();
    solve();
    ouput();
  }
}
