#include <bits/stdc++.h>
using namespace std;
int const B = 61;
int const MAX = 1e5 + 41;
bool bit(long long m, int i) { return ((m >> i) & 1); }
struct Trie {
  Trie *one, *zero;
  int q;
  vector<int> pos;
  Trie() {
    q = 0;
    one = zero = NULL;
  };
  void push(long long m, int p, int b = B) {
    q++;
    if (b == -1) {
      pos.push_back(p);
      return;
    }
    if (bit(m, b)) {
      if (!one) one = new Trie();
      one->push(m, p, b - 1);
    } else {
      if (!zero) zero = new Trie();
      zero->push(m, p, b - 1);
    }
  }
  void pop(long long m, int p, int b = B) {
    q--;
    if (b == -1) {
      pos.pop_back();
      return;
    }
    if (bit(m, b)) {
      one->pop(m, p, b - 1);
    } else {
      zero->pop(m, p, b - 1);
    }
  }
  int go(long long m, long long cur, int f = 0, int b = B) {
    if (q == 0) return -1;
    if (b == -1) {
      if (!f) return -1;
      return pos.back();
    }
    if (f) {
      if (bit(m, b)) {
        if (one && one->q) {
          return one->go(m, cur, 1, b - 1);
        } else {
          if (!zero) return -1;
          return zero->go(m, cur, 1, b - 1);
        }
      } else {
        if (zero && zero->q) {
          return zero->go(m, cur, 1, b - 1);
        } else {
          if (!one) return -1;
          return one->go(m, cur, 1, b - 1);
        }
      }
    } else {
      if (bit(m, b)) {
        if (bit(cur, b)) {
          if (!zero) return -1;
          return zero->go(m, cur, 0, b - 1);
        } else {
          if (one) {
            int resp = one->go(m, cur, 0, b - 1);
            if (resp != -1) return resp;
          }
          if (zero) {
            return zero->go(m, cur, 1, b - 1);
          }
          return -1;
        }
      } else {
        if (bit(cur, b)) {
          if (!one) return -1;
          return one->go(m, cur, 0, b - 1);
        } else {
          if (zero) {
            int resp = zero->go(m, cur, 0, b - 1);
            if (resp != -1) return resp;
          }
          if (one) {
            return one->go(m, cur, 1, b - 1);
          }
          return -1;
        }
      }
    }
  }
};
Trie root;
long long a[MAX];
int n;
long long b[MAX];
long long ans[MAX];
long long const INF = 4e18;
void bad() {
  printf("No\n");
  exit(0);
}
void solve() {
  for (int i = 1; i <= n; i++) {
    root.push(a[i], i);
  }
  ans[0] = 0;
  long long mask = 0;
  for (int i = 1; i <= n; i++) {
    int pos = root.go(mask, ans[i - 1]);
    if (pos == -1) {
      bad();
    }
    ans[i] = (mask ^ a[pos]);
    mask ^= a[pos];
    root.pop(a[pos], pos);
    b[i] = a[pos];
  }
  for (int i = 2; i <= n; i++) {
    if (ans[i] <= ans[i - 1]) bad();
  }
  printf("Yes\n");
  for (int i = 1; i <= n; i++) {
    printf("%lld ", b[i]);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  solve();
  return 0;
}
