#include <bits/stdc++.h>
using namespace std;
int n;
vector<long long> fo[61];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    long long tmp;
    scanf("%lld", &tmp);
    for (int j = 60; j >= 0; --j) {
      if (tmp & (1LL << j)) {
        fo[j].push_back(tmp);
        break;
      }
    }
  }
  long long curr = 0;
  vector<long long> sol;
  for (int i = 0; i < n; ++i) {
    bool ok = false;
    for (int j = 0; j <= 60; ++j) {
      if (!((1LL << j) & curr) && !fo[j].empty()) {
        sol.push_back(fo[j].back());
        curr ^= fo[j].back();
        fo[j].pop_back();
        ok = true;
        break;
      }
    }
    if (!ok) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (auto i : sol) printf("%lld ", i);
}
