#include <bits/stdc++.h>
const int maxx = 1e5 + 7;
const int maxn = 1e9 + 1;
using namespace std;
string a[105];
string aa[] = {"1",  "2",   "4",   "8",   "16",   "32",
               "64", "128", "256", "512", "1024", "2048"};
int ans[12];
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(ans, 0, sizeof ans);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      for (int j = 0; j < 12; j++) {
        if (a[i] == aa[j]) {
          ans[j]++;
        }
      }
    }
    for (int i = 0; i < 11; i++) {
      if (ans[i] >= 2) {
        ans[i + 1] += ans[i] / 2;
      }
    }
    if (ans[11] > 0) {
      cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
