#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int i, a[n];
    map<long long int, long long int> m;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] <= 2048) {
        m[a[i]]++;
      }
    }
    long long int j, k = 0, s, p, r[12] = {1,  2,   4,   8,   16,   32,
                                           64, 128, 256, 512, 1024, 2048};
    for (i = 0; i < 12; i++) {
      p = pow(2, (11 - i));
      if (m[p]) {
        r[i] -= m[p];
        if (r[i] <= 0) {
          cout << "Yes\n";
          k = 1;
          break;
        }
        s = m[p];
        for (j = i + 1; j < 12; j++) {
          s = 2 * s;
          r[j] -= s;
          if (r[j] <= 0) {
            cout << "Yes\n";
            k = 1;
            break;
          }
        }
        if (k == 1) break;
      }
    }
    if (k == 0) cout << "No\n";
  }
}
