#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
int t, m, n, k, sum;
long long a[maxn];
queue<long long> q[maxn];
long long p[maxn];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    for (int j = 60; j >= 0; --j) {
      if (a[i] & (1ll << j)) {
        q[j].push(a[i]);
        break;
      }
    }
  }
  long long cnt = 0;
  for (int i = 1; i <= n; ++i) {
    bool f = 0;
    for (int j = 0; j <= 60; ++j) {
      if (!((1ll << j) & cnt) && q[j].size()) {
        p[i] = q[j].front();
        cnt ^= q[j].front();
        q[j].pop();
        f = 1;
        break;
      }
    }
    if (!f) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; ++i) {
    cout << p[i] << ' ';
  }
  cout << endl;
  return 0;
}
