#include <bits/stdc++.h>
using namespace std;
using K = long double;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<ll> a(n);
  for (auto& e : a) cin >> e;
  vector<ll> rs;
  for (int b = 60; b >= 0; --b) {
    vector<ll> na, nrs;
    int j = 0;
    int ok = 1;
    for (int i = 0; i < (((int)(a).size())); ++i) {
      if (a[i] & (1LL << b)) {
        if (!ok) {
          cout << "No\n";
          return 0;
        }
        nrs.push_back(a[i]);
        while (j < ((int)(rs).size()) && !(rs[j] & (1LL << b))) {
          nrs.push_back(rs[j++]);
        }
        if (j < ((int)(rs).size())) {
          nrs.push_back(rs[j++]);
        } else {
          ok = 0;
        }
      } else {
        na.push_back(a[i]);
      }
    }
    while (j < ((int)(rs).size())) nrs.push_back(rs[j++]);
    a = na;
    rs = nrs;
  }
  cout << "Yes\n";
  for (auto& e : rs) cout << e << ' ';
  cout << '\n';
  return 0;
}
