#include <bits/stdc++.h>
using namespace std;
void Run() {
  int n;
  cin >> n;
  vector<long long> b(n);
  for (int i = 0; i < n; ++i) cin >> b[i];
  auto bribese = [&](long long z) { return 63 - __builtin_clzll(z); };
  sort(b.begin(), b.end(),
       [&](long long x, long long y) { return bribese(x) > bribese(y); });
  vector<long long> mais;
  for (int i = 0; i < n;) {
    int j = i;
    while (j < n && bribese(b[j]) == bribese(b[i])) {
      ++j;
    }
    int bit = bribese(b[i]);
    vector<long long>::iterator it;
    for (int k = i; k < j; ++k) {
      if (k == i) {
        it = mais.insert(mais.begin(), b[k]);
        ++it;
      } else {
        while (it != mais.end() && !((*it) & (1LL << bit))) ++it;
        if (it == mais.end()) {
          cout << "No\n";
          return;
        }
        it = mais.insert(++it, b[k]);
        ++it;
      }
    }
    i = j;
  }
  cout << "Yes\n";
  for (long long v : mais) {
    cout << v << ' ';
  }
  cout << '\n';
}
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  Run();
  return 0;
}
