#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n;
int q;
long long a[201];
multiset<long long> s;
int main() {
  cin >> q;
  while (q--) {
    int flag = 0;
    s.clear();
    cin >> n;
    long long x;
    for (int i = 1; i <= n; i++) {
      cin >> x;
      if (x == 2048) flag = 1;
      s.insert(x);
    }
    if (flag) {
      printf("YES\n");
      continue;
    }
    multiset<long long>::iterator it1;
    multiset<long long>::iterator it2;
    while (s.size() >= 2) {
      it1 = s.begin();
      it2 = s.begin();
      it2++;
      long long t1 = *it1;
      long long t2 = *it2;
      if (t1 == t2) {
        if (t1 + t2 == 2048) {
          flag = 1;
          break;
        }
        s.erase(it1);
        s.erase(it2);
        s.insert(t1 + t2);
      } else {
        if (t1 == 2048 || t2 == 2048) {
          flag = 1;
          break;
        }
        s.erase(it1);
      }
    }
    if (flag)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
