#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 100;
const int mod = (int)1e9 + 7;
const int P = (int)1e6 + 7;
const double pi = acos(-1.0);
int n;
long long a[maxn];
vector<int> g[70];
bool cmp(int i, int j) { return a[i] < a[j]; }
void solve() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    scanf("%lld", &a[i]);
    for (int b = (59); b >= (0); --b) {
      if ((a[i] >> b) & 1) {
        g[b].push_back(i);
        break;
      }
    }
  }
  vector<int> ans;
  for (int i = (59); i >= (0); --i) {
    vector<int> nxt;
    int ptr = 0;
    sort((g[i]).begin(), (g[i]).end(), cmp);
    long long cur = 0;
    for (auto x : g[i]) {
      if (cur < (cur ^ a[x]))
        nxt.push_back(x), cur ^= a[x];
      else {
        while (ptr < ((int)(ans).size()) && cur >= (cur ^ a[x])) {
          cur ^= a[ans[ptr]];
          nxt.push_back(ans[ptr++]);
        }
        if (cur >= (cur ^ a[x])) {
          puts("No");
          return;
        }
        cur ^= a[x];
        nxt.push_back(x);
      }
    }
    while (ptr < ((int)(ans).size())) nxt.push_back(ans[ptr++]);
    swap(ans, nxt);
  }
  puts("Yes");
  for (auto x : ans) printf("%lld ", a[x]);
}
int main() {
  srand(time(0));
  int t = 1;
  while (t--) solve();
}
