#include <bits/stdc++.h>
using namespace std;
long long bin[61], a[100001], now, ans[100001];
int n;
queue<long long> Q[61];
int main() {
  int i, j, flag;
  cin >> n;
  bin[0] = 1;
  for (i = 1; i <= 60; i++) bin[i] = bin[i - 1] * 2;
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    for (j = 60; j >= 0; j--)
      if (a[i] & bin[j]) {
        Q[j].push(a[i]);
        break;
      }
  }
  now = 0;
  for (i = 1; i <= n; i++) {
    flag = 0;
    for (j = 0; j <= 60; j++) {
      if ((now & bin[j]) == 0) {
        if (Q[j].empty()) continue;
        long long x = Q[j].front();
        Q[j].pop();
        flag = 1;
        ans[i] = x;
        now = now ^ x;
        break;
      }
    }
    if (flag == 0) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  for (i = 1; i <= n; i++) printf("%I64d ", ans[i]);
}
