#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    priority_queue<int, vector<int>, greater<int>> pq;
    while (n--) {
      int x;
      cin >> x;
      if (x <= 2048) pq.push(x);
    }
    while (pq.size() >= 2 && pq.top() < 2048) {
      int a = pq.top();
      pq.pop();
      if (a != pq.top()) continue;
      pq.pop();
      pq.push(a * 2);
    }
    if (pq.size() && pq.top() == 2048)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
