#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long mx = 3e5;
const long long lg = 62;
long long n, a[mx];
vector<vector<long long> > v;
vector<long long> cur;
long long get_max_bit(long long x) {
  for (long long i = lg - 1; i >= 0; --i) {
    if ((x >> i) & 1) return i;
  }
  return -1;
}
int main() {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  v.resize(lg);
  for (long long i = 0; i < n; ++i) {
    v[get_max_bit(a[i])].push_back(a[i]);
  }
  for (long long i = lg - 1; i >= 0; --i) {
    vector<long long> pos;
    long long cs = cur.size();
    for (long long j = 0; j < cs; ++j) {
      if ((cur[j] >> i) & 1) pos.push_back(j);
    }
    if (pos.size() == 0)
      pos.push_back(0);
    else {
      pos.push_back(pos.back() + 1);
    }
    if (pos.size() < v[i].size()) {
      cout << "No" << endl;
      return 0;
    }
    pos.resize(v[i].size());
    long long ptr = 0;
    vector<long long> new_cur;
    for (long long j = 0; j <= cs; ++j) {
      if (ptr < pos.size() && pos[ptr] == j) {
        new_cur.push_back(v[i][ptr]);
        ptr++;
      }
      if (j < cs) {
        new_cur.push_back(cur[j]);
      }
    }
    cur = new_cur;
  }
  cout << "Yes" << endl;
  for (auto x : cur) {
    cout << x << " ";
  }
  cout << endl;
}
