#include <bits/stdc++.h>
using namespace std;
bool visit[100005];
int n, m;
vector<long long> g[100005];
const int d = 60;
long long a[100005], b[100005], ans;
long long read() {
  char c = getchar();
  long long x = 0;
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  return x;
}
int main() {
  n = (int)read();
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
    for (int j = d - 1; j >= 0; --j)
      if (a[i] >> j & 1) {
        g[j].push_back(a[i]);
        break;
      }
  }
  for (int i = 1; i <= n; ++i) {
    bool issolve = false;
    for (int j = 0; j < d; ++j) {
      if (ans >> j & 1 || g[j].empty()) continue;
      issolve = true;
      ans ^= g[j].back();
      b[i] = g[j].back();
      g[j].pop_back();
      break;
    }
    if (!issolve) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; ++i) printf("%I64d ", b[i]);
}
