#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10, M = 61;
long long n;
long long a[N];
vector<long long> g[100], ans;
bool Solve(void) {
  long long now = 0;
  ans.clear();
  for (long long i = 1; i <= n; ++i) {
    bool flag = 0;
    for (long long j = 0; j < M; ++j)
      if (!(now & (1LL << j))) {
        if ((long long)g[j].size() == 0) continue;
        long long x = g[j].back();
        g[j].pop_back();
        ans.push_back(x);
        now ^= x;
        flag = 1;
        break;
      }
    if (!flag) return 0;
  }
  return 1;
}
signed main(void) {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; ++i) scanf("%lld", a + i);
  for (long long i = 1; i <= n; ++i) {
    long long p = M - 1;
    for (; p >= 0; --p)
      if (a[i] & (1LL << p)) break;
    g[p].push_back(a[i]);
  }
  if (!Solve())
    puts("No");
  else {
    puts("Yes");
    for (long long i = 1; i <= n; ++i) printf("%lld ", ans[i - 1]);
  }
  return 0;
}
