#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5 + 5;
int n;
multiset<long long> s[66];
map<long long, int> c;
vector<long long> ans;
void add(long long x) {
  for (int(i) = (int)(60); (i) >= (int)(0); --(i))
    if (x & (1LL << i)) {
      s[i].insert(x);
      break;
    }
}
int main() {
  scanf("%d", &n);
  for (int(i) = (int)(1); (i) <= (int)(n); ++(i)) {
    long long x;
    scanf("%lld", &x);
    add(x);
    ++c[x];
  }
  long long cur = (*c.begin()).first;
  --(*c.begin()).second;
  ans.push_back(cur);
  while (--n) {
    bool flag = 0;
    for (int(i) = (int)(0); (i) <= (int)(60); ++(i))
      if (~cur & (1LL << i)) {
        while (!s[i].empty()) {
          if (c[*s[i].begin()] == 0)
            s[i].erase(s[i].begin());
          else
            break;
        }
        if (s[i].empty()) continue;
        long long v = *s[i].begin();
        ans.push_back(v);
        cur ^= v;
        --c[v];
        s[i].erase(s[i].begin());
        flag = 1;
        break;
      }
    if (!flag && n) {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  for (int(i) = (int)(0); (i) < (int)(ans.size()); ++(i))
    printf("%lld%c", ans[i], " \n"[i == ans.size() - 1]);
  return 0;
}
