#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n;
  long long a[100];
  cin >> q;
  for (int i = 0; i < q; ++i) {
    bool ok = false;
    int temp = 2048;
    cin >> n;
    for (int j = 0; j < n; ++j) {
      cin >> a[j];
      if (a[j] == 2048) ok = true;
    }
    sort(a, a + n);
    if (ok == false) {
      for (int j = n - 1; j >= 0; --j) {
        if (a[j] <= 2048) {
          temp -= a[j];
          if (temp == 0) {
            ok = true;
            break;
          }
        }
      }
    }
    if (ok == true)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
