#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  for (int _ = 0; _ < q; _++) {
    int n;
    cin >> n;
    vector<long long> a(n);
    vector<int> dp(13);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      long long x = 1;
      int c = 0;
      while (x < a[i] && a[i] <= 2048) {
        x *= 2;
        c++;
      }
      if (a[i] > 2048)
        c = 0;
      else
        dp[c]++;
    }
    if (dp[11] > 0)
      cout << "YES" << endl;
    else {
      for (int i = 0; i < 11; i++) {
        if (dp[i] > 1) {
          dp[i] -= 2;
          dp[i + 1]++;
          i = -1;
        }
      }
      if (dp[11] > 0)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
