#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MAXN = 1e5;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  int MAXB = 60;
  vector<vector<long long>> byFirst(MAXB);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    for (int j = MAXB - 1; j >= 0; --j) {
      if ((a[i] >> j) & 1) {
        byFirst[j].push_back(a[i]);
        break;
      }
    }
  }
  vector<long long> cur;
  for (int j = MAXB - 1; j >= 0; --j) {
    if (byFirst[j].size() == 0) {
      continue;
    }
    vector<long long> nxt;
    int p = 0;
    nxt.push_back(byFirst[j][0]);
    for (int i = 1; i < byFirst[j].size(); ++i) {
      long long x = byFirst[j][i];
      while (p < cur.size()) {
        if ((cur[p] >> j) & 1) {
          break;
        }
        nxt.push_back(cur[p]);
        p++;
      }
      if (p == cur.size()) {
        cout << "No\n";
        return 0;
      }
      nxt.push_back(cur[p]);
      p++;
      nxt.push_back(x);
    }
    while (p < cur.size()) {
      nxt.push_back(cur[p]);
      p++;
    }
    cur = nxt;
  }
  cout << "Yes\n";
  for (auto x : cur) {
    cout << x << ' ';
  }
  cout << '\n';
  return 0;
}
