#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  bool ans;
  while (t--) {
    ans = false;
    int n, a[1005];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    int s = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (s + a[i] <= 2048) s += a[i];
      if (s == 2048) {
        ans = true;
        break;
      }
    }
    cout << (ans ? "YES" : "NO") << endl;
  }
  return 0;
}
