#include <bits/stdc++.h>
using namespace std;
vector<long long int> bits[65];
vector<long long int> ans, tmp;
int main(void) {
  int n;
  scanf("%d", &n);
  int i, j;
  for (i = 0; i < n; i++) {
    long long int d;
    scanf("%lld", &d);
    long long int dd = d;
    int k = 0, x = 0;
    while (dd) {
      if (dd & 1) x = k;
      k++;
      dd >>= 1;
    }
    bits[x].push_back(d);
  }
  bool ok = true;
  for (j = 60; j >= 0; j--) {
    if (bits[j].size() == 0) continue;
    tmp.clear();
    int x = 0;
    tmp.push_back(bits[j][x++]);
    for (auto u : ans) {
      tmp.push_back(u);
      if (((u >> j) & 1) && x < bits[j].size()) {
        tmp.push_back(bits[j][x++]);
      }
    }
    if (x != bits[j].size()) {
      ok = false;
      break;
    }
    ans.clear();
    for (auto u : tmp) {
      ans.push_back(u);
    }
  }
  if (ok) {
    printf("Yes\n");
    for (auto u : ans) printf("%lld ", u);
    printf("\n");
  } else {
    printf("No\n");
  }
  return 0;
}
