#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;
const long long LOGN = 60;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> res;
  for (long long k = LOGN - 1; k >= 0; k--) {
    vector<long long> x, y;
    for (long long i = 0; i < n; i++) {
      if (a[i] < (1LL << k)) continue;
      if (a[i] < (1LL << (k + 1))) {
        x.push_back(a[i]);
      }
    }
    for (long long i = 0; i < (long long)res.size(); i++) {
      if (res[i] & (1LL << k)) {
        y.push_back(i);
      }
    }
    if (x.size() > y.size() + 1) {
      cout << "No\n";
      return 0;
    }
    vector<long long> nres;
    long long idy = 0, now = 0;
    while (x.size() > 1) {
      nres.push_back(x.back());
      x.pop_back();
      while (now != y[idy]) {
        nres.push_back(res[now++]);
      }
      nres.push_back(res[now++]);
      idy++;
    }
    if (x.size()) {
      nres.push_back(x[0]);
    }
    while (now < res.size()) {
      nres.push_back(res[now++]);
    }
    res = nres;
  }
  cout << "Yes\n";
  for (long long x : res) {
    cout << x << " ";
  }
}
