#include <bits/stdc++.h>
using namespace std;
inline long long GCD(long long a, long long b) {
  while (b != 0) {
    int t = a;
    a = b;
    b = t % b;
  }
  return a;
}
inline long long LCM(long long a, long long b) {
  if (a == 0 || b == 0) return GCD(a, b);
  return a * b / GCD(a, b);
}
inline long long CEIL(long long n, long long d) { return n / d + n % d != 0; }
inline long long ROUND(long long n, long long d) {
  return n / d + (long long)((n % d) * 2 >= d);
}
inline long long POW(long long a, long long n) {
  if (n < 0) return 0;
  long long ret = 1;
  while (n) {
    if (n % 2) ret *= a;
    a = a * a;
    n /= 2;
  }
  return ret;
}
const int MAXN = 1e5;
int n;
long long ar[MAXN];
vector<long long> s[64];
vector<long long> res, t;
void input() {
  cin >> n;
  for (int(i) = (0); (i) < (int)(n); ++(i)) cin >> ar[i];
}
int solve() {
  for (int(i) = (0); (i) < (int)(n); ++(i))
    s[63 - __builtin_clzll(ar[i])].push_back(ar[i]);
  for (int(i) = (0); (i) < (int)(64); ++(i))
    sort(s[i].begin(), s[i].end(),
         [](long long u, long long v) { return u > v; });
  for (int(i) = (63); (i) >= (int)(0); --(i)) {
    if (s[i].size() == 0) continue;
    int cnt = 0;
    for (int(j) = (0); (j) < (int)(res.size()); ++(j))
      if (res[j] & (1ll << i)) ++cnt;
    if (s[i].size() > cnt + 1) return printf("No\n");
    t.clear();
    int x = 0, y = 0, c = 0;
    while (x < s[i].size() || y < res.size()) {
      if (x == c && x < s[i].size())
        t.push_back(s[i][x++]);
      else {
        if (res[y] & (1ll << i)) ++c;
        t.push_back(res[y++]);
      }
    }
    res = t;
  }
  assert(res.size() == n);
  printf("Yes\n");
  for (int(i) = (0); (i) < (int)(n); ++(i)) printf("%lld ", res[i]);
  return printf("\n");
}
void execute() { input(), solve(); }
int main(void) {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  execute();
}
