#include <bits/stdc++.h>
using namespace std;
int n, i, sum;
int main() {
  int q;
  cin >> q;
  while (q--) {
    sum = 0;
    cin >> n;
    int a[n + 1];
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    bool is = 0;
    for (i = 0; i < n; i++) {
      if (a[i] < 2048)
        sum += a[i];
      else if (a[i] == 2048) {
        is = 1;
        break;
      }
    }
    cout << (is || sum >= 2048 ? "Yes" : "No") << endl;
  }
  return 0;
}
