#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, x, i, n;
  cin >> q;
  while (q--) {
    cin >> n;
    int a[n];
    for (i = 0; i < n; i++) {
      cin >> x;
      a[i] = round((1.0 * log(x)) / (1.0 * log(2)));
    }
    sort(a, a + n);
    for (i = 0; i < n - 1; i++) {
      if (a[i] == 11) break;
      if (a[i] == a[i + 1]) {
        a[i] = -1;
        a[i + 1]++;
        sort(a, a + n);
      }
    }
    if (a[i] == 11)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
