#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 3e5 + 5;
int n;
long long int num[MAX];
stack<int> s[100];
vector<long long> v;
int hb[MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  long long int x = 0;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
    x ^= num[i];
    for (int j = 60; j >= 0; j--) {
      if ((num[i] & (1ll << j))) {
        hb[i] = j;
        break;
      }
    }
    s[hb[i]].push(i);
  }
  for (int i = 1; i <= n; i++) {
    int can = 0;
    for (int j = 0; j <= 60; j++)
      if (((x & (1ll << j)) != 0) && (!s[j].empty())) {
        can = s[j].top();
        s[j].pop();
        break;
      }
    if (can == 0) {
      cout << "No";
      return 0;
    }
    v.push_back(num[can]);
    x ^= num[can];
  }
  reverse(v.begin(), v.end());
  cout << "Yes" << endl;
  for (int i = 0; i < n; i++) cout << v[i] << ' ';
  return 0;
}
