#include <bits/stdc++.h>
using namespace std;
const int mod = (int)(1e9 + 7);
vector<int> read(int n) {
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  return v;
}
bool isSubsetSum(vector<int> arr, int n, int sum) {
  bool subset[2][sum + 1];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= sum; j++) {
      if (j == 0)
        subset[i % 2][j] = true;
      else if (i == 0)
        subset[i % 2][j] = false;
      else if (arr[i - 1] <= j)
        subset[i % 2][j] =
            subset[(i + 1) % 2][j - arr[i - 1]] || subset[(i + 1) % 2][j];
      else
        subset[i % 2][j] = subset[(i + 1) % 2][j];
    }
  }
  return subset[n % 2][sum];
}
void solve() {
  long long int i, j, k, m, n, ans = 0, cnt = 0, sum = 0;
  cin >> n;
  vector<int> v = read(n);
  if (isSubsetSum(v, n, 2048)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
