#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 229;
const long long M = 1e9 + 7;
const long long M2 = 1e9 + 9;
const long long mod = 998244353;
const int rx[8] = {1, 1, -1, -1, -2, -2, 2, 2};
const int ry[8] = {-2, 2, -2, 2, 1, -1, 1, -1};
const long double eps = 1e-7;
const double pi = acos(-1.0);
long long ot[N], a[N];
int sz = 0, k[4 * N], nxt[N * 4][2];
void add(long long x) {
  int v = 0, to = 0;
  for (int i = 59; i >= 0; --i) {
    to = 0;
    if ((1ll << i) & x) {
      to = 1;
    }
    if (!nxt[v][to]) {
      ++sz;
      nxt[v][to] = sz;
    }
    v = nxt[v][to];
    ++k[v];
  }
}
void del(long long x) {
  int v = 0, to = 0;
  for (int i = 59; i >= 0; --i) {
    to = 0;
    if ((1ll << i) & x) {
      to = 1;
    }
    v = nxt[v][to];
    --k[v];
  }
}
int find_bit(long long x) {
  int v = 0, to = 0;
  int ot = 1e9;
  for (int i = 59; i >= 0; --i) {
    to = 0;
    if (!((1ll << i) & x) && nxt[v][1] && k[nxt[v][1]]) {
      ot = min(ot, i);
    }
    if (!nxt[v][to]) {
      break;
    }
    v = nxt[v][to];
  }
  if (ot == 1e9) {
    ot = -1;
  }
  return ot;
}
long long solve(long long x) {
  int v = 0, to = 0, j = find_bit(x);
  long long ot = 0;
  if (j == -1) {
    return -1;
  }
  for (int i = 59; i >= 0; --i) {
    to = 0;
    if (i > j) {
      v = nxt[v][to];
    } else if (i == j) {
      ot += (1ll << i);
      v = nxt[v][1];
    } else {
      if ((1ll << i) & x) {
        to = 1;
      }
      if (!nxt[v][to] || !k[nxt[v][to]]) {
        to = !to;
      }
      if (to) {
        ot += (1ll << i);
      }
      v = nxt[v][to];
    }
  }
  return ot;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  int n, ind = 0;
  long long now = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] < a[ind]) {
      ind = i;
    }
    add(a[i]);
  }
  ot[0] = a[ind];
  now = a[ind];
  del(a[ind]);
  for (int i = 1; i < n; ++i) {
    ot[i] = solve(now);
    del(ot[i]);
    if (ot[i] == -1) {
      cout << "No";
      return 0;
    }
    now ^= ot[i];
  }
  now = 0;
  for (int i = 0; i < n; ++i) {
    if (now >= (now ^ ot[i])) {
      cout << "No";
      return 0;
    }
    now ^= ot[i];
  }
  cout << "Yes" << '\n';
  for (int i = 0; i < n; ++i) {
    cout << ot[i] << ' ';
  }
  return 0;
}
