#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  int q, c = 0;
  cin >> q;
  for (int i = 0; i < q; i = i + 1) {
    int n;
    cin >> n;
    for (int j = 0; j < n; j = j + 1) {
      int a;
      cin >> a;
      mp[a] = mp[a] + 1;
    }
    for (int j = 0; j < n - 1; j = j + 1) {
      for (auto x : mp) {
        if (x.second > 1) {
          mp[(x.first) * 2] = mp[(x.first) * 2] + 1;
          mp[x.first] = mp[x.first] - 2;
        }
      }
    }
    for (auto y : mp) {
      if (y.first == 2048) {
        cout << "YES" << endl;
        c = 1;
        break;
      }
    }
    if (c == 0) {
      cout << "NO" << endl;
    }
    c = 0;
    mp.clear();
  }
  return 0;
}
