#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[105];
multiset<int> q;
int main() {
  int _;
  scanf("%d", &_);
  while (_--) {
    int n;
    scanf("%d", &n);
    bool flag = 0;
    q.clear();
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] == 2048) flag = 1;
      q.insert(a[i]);
    }
    if (flag) {
      puts("YES");
      continue;
    }
    set<int>::iterator it;
    int tmp = 0;
    while (!q.empty()) {
      it = q.begin();
      q.erase(it);
      if (tmp != *it)
        tmp = *it;
      else {
        tmp += *it;
        if (tmp == 2048) {
          flag = 1;
          break;
        }
        q.insert(tmp);
        tmp = 0;
      }
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
