#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int zzzz;
  cin >> zzzz;
  while (zzzz--) {
    int n;
    cin >> n;
    multiset<int> lala;
    for (int i = 1; i <= n; ++i) {
      int temp;
      cin >> temp;
      lala.insert(temp);
    }
    bool found = false;
    while (!lala.empty()) {
      auto it = lala.begin();
      int temp = *it;
      if (temp == 2048) {
        found = true;
        break;
      }
      lala.erase(it);
      auto it2 = lala.begin();
      if (it2 == lala.end()) break;
      int temp2 = *it2;
      if (temp != temp2) continue;
      lala.erase(it2);
      lala.insert(temp * 2);
    }
    if (found)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
