#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> v(n);
    for (auto &x : v) cin >> x;
    sort(v.begin(), v.end());
    int k = 2048;
    for (int i = n - 1; i >= 0; --i) {
      int x = v[i];
      if (k - x >= 0) k -= x;
    }
    int f = 0;
    if (k == 0) f = 1;
    cout << (f ? "YES" : "NO") << endl;
  }
  return 0;
}
