#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  vector<long long> vec(n);
  for (int i = 0; i < n; i++) cin >> vec[i];
  queue<long long> q[70];
  for (int i = 0; i < n; i++) {
    int cur = -1;
    for (int j = 60; j >= 0; j--) {
      if (vec[i] & (1LL << j)) {
        cur = j;
        break;
      }
    }
    q[cur].push(i);
  }
  long long ans = 0;
  vector<long long> res;
  for (int i = 0; i < n; i++) {
    long long cur = -1;
    for (int j = 0; j <= 60; j++) {
      if ((ans & (1LL << j)) == 0 && q[j].size()) {
        cur = q[j].front();
        q[j].pop();
        break;
      }
    }
    if (cur == -1) {
      cout << "No" << endl;
      return 0;
    }
    res.push_back(vec[cur]);
    ans = ans ^ vec[cur];
  }
  cout << "Yes" << endl;
  for (int i = 0; i < vec.size(); i++) cout << res[i] << " ";
  cout << endl;
  return 0;
}
