#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e5 + 7;
long long n, m, a[maxn], b[maxn];
vector<long long> vt[100];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> b[i];
    long long gau = b[i];
    long long dem = 0;
    while (gau > 0) {
      gau >>= 1;
      dem++;
    }
    vt[--dem].push_back(b[i]);
  }
  bool d = true;
  long long gau = 0;
  for (long long i = 1; i <= n; i++) {
    if (!d) return cout << "No", 0;
    d = false;
    for (long long j = 0; j <= 61; j++) {
      if (((gau >> j) & 1) != 0 || vt[j].empty()) continue;
      gau ^= vt[j].back();
      a[i] = vt[j].back();
      vt[j].pop_back();
      d = true;
      break;
    }
  }
  if (!d) return cout << "No", 0;
  cout << "Yes" << '\n';
  for (long long i = 1; i <= n; i += 1) cout << a[i] << ' ';
}
