#include <bits/stdc++.h>
using namespace std;
struct re {
  int x, y;
};
const int inf = 1e9 + 10;
const int N = 1e3 + 10;
int n, T, a[N];
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int cur = a[1], sl = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == 1 || a[i] == a[i - 1])
      ++sl;
    else {
      while (cur != a[i]) {
        cur *= 2;
        sl /= 2;
        if (cur == 2048 && sl) {
          cout << "YES";
          return;
        }
      }
      ++sl;
    }
    if (cur == 2048) {
      cout << "YES";
      return;
    } else if (cur > 2048) {
      cout << "NO";
      return;
    }
  }
  while (cur != 2048) {
    cur *= 2;
    sl /= 2;
  }
  if (sl) {
    cout << "YES";
    return;
  } else {
    cout << "NO";
    return;
  }
}
int main() {
  cin >> T;
  while (T--) {
    solve();
    cout << endl;
  }
  return 0;
}
