#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 7;
const int inf = 1e9 + 7;
int q;
int n;
int cnt[15];
map<int, int> mp;
int main() {
  for (int i = 0; i <= 12; i++) mp[(1 << i)] = i;
  cin >> q;
  while (q--) {
    memset(cnt, 0, sizeof(cnt));
    cin >> n;
    int num;
    for (int i = 0; i < n; i++) {
      cin >> num;
      if (num <= 2048) cnt[mp[num]]++;
    }
    for (int i = 0; i < 12; i++) {
      if (cnt[i] >= 2) {
        cnt[i + 1] += cnt[i] / 2;
      }
    }
    if (cnt[11] > 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
