#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long q, n, x, first;
  cin >> q;
  while (q--) {
    cin >> n;
    first = 0;
    vector<int> v(n), sum(n + 1);
    for (int i = 0; i < n; i++) {
      cin >> v[i];
    }
    sort(v.begin(), v.end());
    sum[0] = 0;
    for (int i = 0; i < n; i++) sum[i + 1] = v[i] + sum[i];
    for (int i = 0; i < n; i++) {
      for (int j = i; j < n; j++) {
        if (sum[j + 1] - sum[i] == 2048) {
          first = 1;
          break;
        }
      }
      if (first == 1) break;
    }
    if (first == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
