#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int q = 0; q < t; q++) {
    int n;
    cin >> n;
    int a[30] = {0};
    for (int i = 0; i < n; i++) {
      unsigned long long int temp;
      cin >> temp;
      a[(int)log2(temp)]++;
    }
    for (int i = 0; i < 12; i++) {
      if (a[i] >= 2) {
        a[i + 1] += a[i] / 2;
      }
    }
    if (a[11] != 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
