#include <bits/stdc++.h>
using namespace std;
long long t, n, a, f[20];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a;
      long long p = 0;
      if (a <= 2048) {
        while (a) {
          a /= 2;
          p++;
        }
        f[p]++;
      }
    }
    for (int j = 0; j <= 11; j++) f[j + 1] = f[j + 1] + (f[j] / 2);
    if (f[12] > 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    for (int j = 0; j <= 12; j++) f[j] = 0;
  }
}
