#include <bits/stdc++.h>
using namespace std;
const int N = 1000050;
struct date {
  long long s;
  int x;
  bool operator<(const date &c) const { return x > c.x; }
} a[N];
int head, nx[N];
int main() {
  int n, d;
  cin >> n;
  long long s;
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &s);
    a[i].s = s, d = 0;
    while (s > 1) s >>= 1, ++d;
    a[i].x = d;
  }
  sort(a + 1, a + n + 1);
  a[n + 1].x = -1;
  for (int i = 1; i <= n; ++i) {
    int flag = 1;
    int t = i, id;
    while (a[t + 1].x == a[i].x) ++t;
    nx[i] = head, head = i, s = a[t].s;
    id = head;
    for (int j = i + 1; j <= t; ++j) {
      while (id && (s ^ a[j].s) <= s) id = nx[id], s ^= a[id].s;
      if (!id) {
        flag = 0;
        break;
      }
      nx[j] = nx[id], nx[id] = j, id = j, s ^= a[j].s;
    }
    if (!flag) return puts("No"), 0;
    i = t;
  }
  puts("Yes");
  for (int i = head; i; i = nx[i]) printf("%I64d ", a[i].s);
  return 0;
}
