#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
void solve();
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
int mylog2(long long x) {
  for (int i = 1; i < 61; i++) {
    if ((x >> i) == 0) return i - 1;
  }
  return -1;
}
void solve() {
  int n;
  cin >> n;
  vector<vector<long long> > groups(60, vector<long long>());
  for (int i = 0; i < n; i++) {
    long long b;
    cin >> b;
    groups[mylog2(b)].push_back(b);
  }
  long long cur = 0;
  vector<long long> ans(n);
  for (int i = 0; i < n; i++) {
    int j;
    for (j = 0; j < 60; j++) {
      if (!groups[j].empty() && (cur ^ groups[j].back()) > cur) {
        cur ^= groups[j].back();
        ans[i] = groups[j].back();
        groups[j].pop_back();
        break;
      }
    }
    if (j == 60) {
      cout << "No";
      return;
    }
  }
  cout << "Yes" << endl;
  for (int i = 0; i < n; i++) {
    cout << ans[i] << ' ';
  }
}
