Vitya has learned that the answer for The Ultimate Question of Life, the Universe, and Everything is not the integer 54 42, but an increasing integer sequence a_1, …, a_n. In order to not reveal the secret earlier than needed, Vitya encrypted the answer and obtained the sequence b_1, …, b_n using the following rules:

  * b_1 = a_1;
  * b_i = a_i ⊕ a_{i - 1} for all i from 2 to n, where x ⊕ y is the [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of x and y. 



It is easy to see that the original sequence can be obtained using the rule a_i = b_1 ⊕ … ⊕ b_i.

However, some time later Vitya discovered that the integers b_i in the cypher got shuffled, and it can happen that when decrypted using the rule mentioned above, it can produce a sequence that is not increasing. In order to save his reputation in the scientific community, Vasya decided to find some permutation of integers b_i so that the sequence a_i = b_1 ⊕ … ⊕ b_i is strictly increasing. Help him find such a permutation or determine that it is impossible.

Input

The first line contains a single integer n (1 ≤ n ≤ 10^5).

The second line contains n integers b_1, …, b_n (1 ≤ b_i < 2^{60}).

Output

If there are no valid permutations, print a single line containing "No".

Otherwise in the first line print the word "Yes", and in the second line print integers b'_1, …, b'_n — a valid permutation of integers b_i. The unordered multisets \\{b_1, …, b_n\} and \\{b'_1, …, b'_n\} should be equal, i. e. for each integer x the number of occurrences of x in the first multiset should be equal to the number of occurrences of x in the second multiset. Apart from this, the sequence a_i = b'_1 ⊕ … ⊕ b'_i should be strictly increasing.

If there are multiple answers, print any of them.

Examples

Input

3
1 2 3


Output

No


Input

6
4 7 7 12 31 61


Output

Yes
4 12 7 31 7 61 

Note

In the first example no permutation is valid.

In the second example the given answer lead to the sequence a_1 = 4, a_2 = 8, a_3 = 15, a_4 = 16, a_5 = 23, a_6 = 42.
#include <bits/stdc++.h>
using namespace std;
bool dbg = 0;
clock_t start_time = clock();
void bad(string mes = "Impossible") {
  cout << mes;
  exit(0);
}
void bad(int mes) {
  cout << mes;
  exit(0);
}
template <typename T>
string bin(T x, int st = 2) {
  string ans = "";
  while (x > 0) {
    ans += char('0' + x % st);
    x /= st;
  }
  reverse(ans.begin(), ans.end());
  return ans.empty() ? "0" : ans;
}
template <typename T>
void amax(T& x, T y) {
  x = max(x, y);
}
template <typename T>
void amin(T& x, T y) {
  x = min(x, y);
}
template <typename T>
T input() {
  T ans = 0, m = 1;
  char c = ' ';
  while (!((c >= '0' && c <= '9') || c == '-')) {
    c = getchar();
  }
  if (c == '-') m = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + (c - '0'), c = getchar();
  }
  return ans * m;
}
template <typename T>
void read(T& a) {
  a = input<T>();
}
template <typename T>
void read(T& a, T& b) {
  read(a), read(b);
}
template <typename T>
void read(T& a, T& b, T& c) {
  read(a, b), read(c);
}
template <typename T>
void read(T& a, T& b, T& c, T& d) {
  read(a, b), read(c, d);
}
const int inf = 1e9 + 20;
const short short_inf = 3e4 + 20;
const long double eps = 1e-15;
const int maxn = (int)1e6 + 12, base = 1e9 + 7;
const long long llinf = 2e18 + 5;
template <typename T>
T binpow(T n, T second) {
  if (second <= 0) return 1LL;
  if (second % 2 == 0) {
    T b = binpow(n, second / 2);
    return (1LL * b * b) % base;
  } else {
    return (1LL * binpow(n, second - 1) * n) % base;
  }
}
long long a[maxn];
long long new_sz[maxn];
int was[maxn];
long long l[2][maxn];
inline void merge(int& pred_sz, int& sz_nex, int& cur, int& cur_sz, int& k) {
  int i = 1, j = 1, ok = 1;
  while (j <= sz_nex || i <= pred_sz) {
    if (j <= sz_nex) {
      if (ok) {
        l[cur][++cur_sz] = new_sz[j++];
        ok = 0;
        continue;
      }
    }
    l[cur][++cur_sz] = l[1 - cur][i++];
    if (l[cur][cur_sz] & (1ll << k)) ok ^= 1;
  }
}
int n, sz_nex;
int find_cnt(int k) {
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!was[i] && (a[i] & (1ll << k))) {
      new_sz[++sz_nex] = a[i];
      cnt++;
      was[i] = 1;
    }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int cur_sz = 0;
  cin >> n;
  long long mx = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    amax(mx, a[i]);
  }
  int mxbit = 0;
  for (int i = 0; i <= 60; i++) {
    if (mx & (1ll << i)) mxbit = i;
  }
  int cur = 0;
  for (int k = mxbit; k >= 0; k--) {
    sz_nex = 0;
    int cnt = find_cnt(k);
    int now = 1;
    for (int i = 1; i <= cur_sz; i++)
      if ((1ll << k) & l[cur][i]) now++;
    cur ^= 1;
    int pred_sz = cur_sz;
    cur_sz = 0;
    if (cnt > now) {
      cout << "No\n";
      return 0;
    } else
      merge(pred_sz, sz_nex, cur, cur_sz, k);
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) cout << l[cur][i] << ' ';
  cout << '\n';
  return 0;
}
