#include <bits/stdc++.h>
const long long mod = 1000000007;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int test;
  cin >> test;
  while (test--) {
    int n, f = 0, i;
    cin >> n;
    vector<long long> arr(n);
    unordered_map<long long, long long> cnt;
    for (i = 0; i < n; i++) {
      cin >> arr[i];
      cnt[arr[i]]++;
    }
    for (long long i = 0; i <= 10; i++) {
      long long num = pow(2, i);
      if (cnt[num] >= 2) {
        cnt[2 * num] += cnt[num] / 2;
      }
    }
    cnt[2048] >= 1 ? cout << "YES" << endl : cout << "NO" << endl;
  }
}
