#include <bits/stdc++.h>
using namespace std;
template <class T>
void test(T a) {
  cout << a << endl;
}
template <class T, class T2>
void test(T a, T2 b) {
  cout << a << " " << b << endl;
}
template <class T, class T2, class T3>
void test(T a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << endl;
}
const int N = 9e8 + 1;
const int M = 1e4 + 10;
const int MAXN = 1e5 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const long long mod = (long long)1e9 + 7;
int T;
void testcase() { printf("Case #%d:\n", ++T); }
queue<long long> q[65];
long long a[MAXN];
long long ans[MAXN];
void work() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); i++) {
    long long x;
    scanf("%lld", &a[i]);
  }
  sort(a, a + n);
  for (int i = 1; i <= (n - 1); i++) {
    for (int j = 61; j >= 0; --j) {
      if ((1LL << j) & a[i]) {
        q[j].push(a[i]);
        break;
      }
    }
  }
  long long now = a[0];
  ans[0] = now;
  for (int i = 1; i <= (n - 1); i++) {
    bool flag = false;
    for (int j = 0; j <= 61; ++j) {
      if (((1LL << j) & now) == 0 && !q[j].empty()) {
        flag = true;
        ans[i] = q[j].front();
        now ^= q[j].front();
        q[j].pop();
        break;
      }
    }
    if (!flag) {
      printf("No\n");
      return;
    }
  }
  printf("Yes\n");
  for (int i = 0; i < (n); i++) {
    printf("%lld ", ans[i]);
  }
}
int main() { work(); }
