#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double eps = (1e-5);
int isGreater(long double x, long double y) {
  if (abs(x - y) < eps) return 0;
  if (x > y) return 1;
  return -1;
}
int n;
vector<long long> b;
const int MAX_N = 1e5 + 5, MAX_S = 61;
int v[MAX_N * MAX_S][2], visitCnt[MAX_N * MAX_S], cntNodes;
int addNode() {
  v[cntNodes][0] = v[cntNodes][1] = -1;
  cntNodes++;
  return cntNodes - 1;
}
const long long INF = 2e18;
void insert(long long x) {
  int u = 0;
  for (int i = 60; i >= 0; --i) {
    visitCnt[u]++;
    int to = (x >> i) & 1;
    if (v[u][to] == -1) v[u][to] = addNode();
    u = v[u][to];
  }
  visitCnt[u]++;
}
long long find(long long x, int must) {
  int u = 0;
  long long ret = 0;
  for (int i = 60; i >= 0; --i) {
    int to = (x >> i) & 1;
    if (i > must)
      to = 0;
    else if (i == must)
      to = 1;
    else {
      if (v[u][1] != -1)
        to = 1;
      else
        to = 0;
    }
    if (v[u][to] == -1) return INF;
    if (to) ret |= (1LL << i);
    u = v[u][to];
  }
  return ret;
}
void erase(long long x) {
  int cur = 0;
  visitCnt[0]--;
  for (int i = 60; i >= 0; --i) {
    int to = (x >> i) & 1;
    int nxt = v[cur][to];
    visitCnt[nxt]--;
    if (!visitCnt[nxt]) v[cur][to] = -1;
    cur = nxt;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  b.resize(n);
  addNode();
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    insert(b[i]);
  }
  long long x = 0;
  vector<long long> out(n);
  for (int cnt = 0; cnt < n; ++cnt) {
    long long minXor = INF, minY;
    for (int i = 0; i <= 60; ++i) {
      if ((x >> i) & 1) continue;
      long long f = (1LL << i);
      f |= (((1LL << i) - 1) & x);
      long long y = find(f, i);
      if (y == INF) continue;
      long long tempXor = (y ^ x);
      if (tempXor < minXor) {
        minXor = tempXor;
        minY = y;
        break;
      }
    }
    if (minXor == INF) {
      cout << "No\n";
      return 0;
    }
    x = minXor;
    out[cnt] = minY;
    erase(minY);
  }
  cout << "Yes\n";
  for (long long item : out) cout << item << ' ';
  return 0;
}
