#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n;
  cin >> T;
  while (T--) {
    cin >> n;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      if (a <= 2048) {
        sum += a;
      }
    }
    if (sum >= 2048)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
