#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long q, n, x, s, flag;
  cin >> q;
  while (q--) {
    flag = 0;
    s = 0;
    cin >> n;
    for (long long i = 0; i < n; i++) {
      cin >> x;
      if (x == 2048) flag = 1;
      if (x > 2048) continue;
      s += x;
    }
    if ((s >= 2048) || (flag))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
