#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
int n;
long long bin[65], a, ans[N];
queue<long long> q[65];
void work() {
  scanf("%d", &n);
  bin[0] = 1;
  for (int i = 1; i <= 60; i++) bin[i] = bin[i - 1] << 1;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a);
    for (int j = 60; j >= 0; j--)
      if (bin[j] & a) {
        q[j].push(a);
        break;
      }
  }
  long long now = 0;
  for (int i = 1, flag = 0; i <= n; i++, flag = 0) {
    for (int j = 0; j <= 60; j++)
      if (!(now & bin[j])) {
        if (q[j].empty()) continue;
        now ^= (ans[i] = q[j].front());
        q[j].pop();
        flag = 1;
        break;
      }
    if (flag == 0) {
      puts("No");
      return;
    }
  }
  puts("Yes");
  for (int i = 1; i <= n; i++) printf("%I64d ", ans[i]);
}
int main() {
  work();
  return 0;
}
