#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int M = 1e9 + 7;
const int N = 7e6 + 7;
long long n, cur = 3e18, V, ans[N], x;
long long nxt[N][2], k[N];
void add(long long x) {
  int v = 0;
  for (long long i = 60; i >= 0; i--) {
    long long to = (x >> i) & 1ll;
    if (!nxt[v][to]) nxt[v][to] = ++V;
    v = nxt[v][to];
    k[v]++;
  }
  return;
}
void del(long long x) {
  int v = 0;
  for (long long i = 60; i >= 0; i--) {
    long long to = (x >> i) & 1ll;
    k[nxt[v][to]]--;
    int vv = nxt[v][to];
    if (!k[nxt[v][to]]) nxt[v][to] = 0;
    v = vv;
  }
  return;
}
long long mn(long long x, int p, int u) {
  int v = u;
  long long res = 0;
  for (long long i = p; i >= 0; i--) {
    long long to = ((x >> i) & 1ll);
    if (nxt[v][to])
      v = nxt[v][to];
    else {
      v = nxt[v][to ^ 1];
      res += 1ll << i;
    }
  }
  return res;
}
long long q(long long x) {
  int v = 0;
  long long ans = 0;
  long long res = 0;
  for (long long i = 60; i >= 0; i--) {
    long long to = ((x >> i) & 1ll);
    if (nxt[v][to ^ 1]) {
      res += 1ll << i;
      v = nxt[v][to ^ 1];
    } else
      v = nxt[v][to];
  }
  ans = res;
  res = 0;
  v = 0;
  for (long long i = 60; i >= 0; i--) {
    long long to = ((x >> i) & 1);
    if (to == 1) {
      if (nxt[v][to ^ 1]) {
        res += 1ll << i;
        v = nxt[v][to ^ 1];
      } else
        break;
    } else {
      if (nxt[v][to ^ 1]) {
        long long curr = res + (1ll << i) + mn(x, i - 1, nxt[v][to ^ 1]);
        if (curr > x) ans = min(ans, curr);
      }
      if (nxt[v][to])
        v = nxt[v][to];
      else
        break;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    add(x);
    cur = min(cur, x);
  }
  ans[0] = cur;
  del(cur);
  for (int i = 1; i < n; i++) {
    long long now = q(cur);
    del(now ^ cur);
    if (now <= cur) {
      cout << "No";
      return 0;
    }
    ans[i] = cur ^ now;
    cur = now;
  }
  cout << "Yes" << '\n';
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
  return 0;
}
