#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    bool p = 0;
    int m, a[100], num = 0;
    long long s;
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> s;
      if (s == 2048) {
        p = 1;
      }
      if (s < 2048) {
        a[num++] = s;
      }
    }
    int w[1025] = {0};
    for (int i = 0; i < num && !p; i++) {
      w[a[i]]++;
    }
    for (int i = 1; i <= 512 && !p; i *= 2) {
      w[i * 2] = w[i * 2] + w[i] / 2;
    }
    if (w[1024] >= 2 || p)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
