#include <bits/stdc++.h>
using namespace std;
int n;
unsigned long long b[100005];
vector<unsigned long long> res;
bool cmp(unsigned long long a, unsigned long long b) { return a > b; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64u", b + i);
  sort(b, b + n, cmp);
  int p = 0;
  for (int i = 60; i >= 0; i--) {
    unsigned long long mask = 1ull << i;
    vector<unsigned long long> curr;
    int p1 = p;
    while (p1 < n && (b[p1] & mask)) curr.push_back(b[p1++]);
    int cnt = curr.size(), cnt1 = 0;
    vector<unsigned long long> nxt;
    if (cnt > 0) nxt.push_back(curr[cnt1++]);
    for (int j = 0; j < p; j++) {
      nxt.push_back(res[j]);
      if (cnt1 < cnt && (res[j] & mask)) nxt.push_back(curr[cnt1++]);
    }
    if (cnt1 < cnt) {
      printf("No\n");
      return 0;
    }
    res.swap(nxt);
    assert(int(res.size()) == p1);
    p = p1;
  }
  printf("Yes\n");
  for (int i = 0; i < n; i++)
    printf(
        "%I64u"
        " ",
        res[i]);
  printf("\n");
  return 0;
}
