#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
vector<long long> cnt[60];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) {
    long long a;
    cin >> a;
    for (int j = (int)(60) - 1; j >= 0; --j) {
      if (a >> j & 1LL) {
        cnt[j].push_back(a);
        break;
      }
    }
  }
  long long nw = 0;
  vector<long long> res;
  for (int i = 0; i < (int)(n); ++i) {
    bool ok = false;
    for (int j = 0; j < (int)(60); ++j) {
      if (!((nw >> j) & 1LL)) {
        if ((int)(cnt[j]).size()) {
          nw ^= cnt[j].back();
          res.push_back(cnt[j].back());
          cnt[j].pop_back();
          ok = true;
          break;
        }
      }
    }
    if (!ok) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  for (int i = 0; i < (int)(n); ++i) {
    cout << res[i] << " ";
  }
  cout << "\n";
  return 0;
}
