#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    int p;
    cin >> p;
    int i = 0, sum = 0;
    int a[p];
    for (i = 0; i < p; i++) {
      cin >> a[i];
    }
    sort(a, a + p, greater<int>());
    for (i = 0; i < p; i++) {
      sum += a[i];
      if (sum > 2048) sum -= a[i];
      if (sum == 2048) break;
    }
    if (i != p)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
