#include <bits/stdc++.h>
using namespace std;
long long N, ans[100001];
stack<long long> stk[61];
int main() {
  long long x;
  cin >> N;
  for (int i = 1; i <= N; ++i) {
    cin >> x;
    for (int j = 60; j >= 0; --j) {
      if (x >> j) {
        stk[j].push(x);
        break;
      }
    }
  }
  long long curr = 0;
  for (int i = 1; i <= N; ++i) {
    for (int j = 0; j <= 60; ++j) {
      if (!stk[j].empty() && !(curr >> j & 1)) {
        curr ^= stk[j].top();
        ans[i] = stk[j].top();
        stk[j].pop();
        break;
      }
      if (j == 60) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= N; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
