#include <bits/stdc++.h>
long long int b[131072];
int l[131072], h[64], ans;
int main() {
  int n, k;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", b + i);
    k = __builtin_clzll(b[i]);
    l[i] = h[k], h[k] = i;
  }
  for (int i = 0; i < 64; ++i) {
    if (!h[i]) continue;
    int new_ans = h[i], t = new_ans;
    for (int j = l[h[i]]; j; j = l[j]) {
      while (ans && !(b[ans] & 1ll << (64 - 1 - i)))
        l[t] = ans, t = ans, ans = l[ans];
      if (!ans) goto tag_no;
      l[t] = ans, t = ans, ans = l[ans];
      l[t] = j, t = j;
    }
    while (ans) l[t] = ans, t = ans, ans = l[ans];
    ans = new_ans;
  }
  puts("Yes");
  for (int i = ans; i; i = l[i]) printf("%lld ", b[i]);
  printf("\n");
  return 0;
tag_no:
  return puts("No"), 0;
}
