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