#include <bits/stdc++.h>
using namespace std;
vector<long long> b;
bool done[100005];
bool gbit(long long num, int pos) { return (num & (1LL << pos)) != 0; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long tmp;
    scanf("%lld", &tmp);
    b.push_back(tmp);
  }
  vector<long long> out;
  for (int bit = 59; bit >= 0; bit--) {
    queue<int> to_ass;
    for (int i = 0; i < n; i++) {
      if (!done[i] && gbit(b[i], bit)) {
        to_ass.push(i);
      }
    }
    vector<long long> cp(out);
    out.clear();
    for (int i = -1; i < (int)(cp.size()); i++) {
      if (i != -1) {
        out.push_back(cp[i]);
      }
      if (!to_ass.empty() && (i == -1 || gbit(cp[i], bit))) {
        int curr = to_ass.front();
        to_ass.pop();
        out.push_back(b[curr]);
        done[curr] = true;
      }
    }
    if (!to_ass.empty()) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  for (long long x : out) {
    printf("%lld ", x);
  }
  return 0;
}
