#include <bits/stdc++.h>
using namespace std;
vector<long long> c[60];
long long n, x, f, a[100001], b[100001];
inline long long read() {
  long long sum = 0, x = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') x = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    sum = sum * 10 + ch - '0';
    ch = getchar();
  }
  return sum * x;
}
inline void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
  return;
}
signed main() {
  n = read();
  for (register long long i = 1; i <= n; ++i) {
    a[i] = read();
    for (register long long j = 59; j >= 0; --j)
      if ((a[i] >> j) & 1) {
        c[j].push_back(a[i]);
        break;
      }
  }
  for (register long long i = 1; i <= n; ++i) {
    f = 0;
    for (register long long j = 0; j < 60; ++j)
      if (c[j].size() && !((x >> j) & 1)) {
        b[i] = c[j].back();
        c[j].pop_back();
        x ^= b[i];
        f = 1;
        break;
      }
    if (!f) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (register long long i = 1; i <= n; ++i) {
    write(b[i]);
    putchar(' ');
  }
  return 0;
}
