#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int solve() {
  int n;
  cin >> n;
  int arr[30]{};
  while (n--) {
    int i;
    cin >> i;
    ++arr[int(round(log2(i)))];
  }
  for (int i = 0; i < 11; ++i) arr[i + 1] += arr[i] / 2;
  cout << (arr[11] ? "YES" : "NO") << '\n';
  return 0;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
