#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int tc, i, j;
  cin >> tc;
  while (tc--) {
    long long int n, s = 0, b;
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> b;
      if (b <= 2048) s += b;
    }
    s >= 2048 ? cout << "YES\n" : cout << "NO\n";
  }
}
