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;
using Int = long long;
template <typename T, Int X>
struct BinaryTrie {
  struct Node {
    bool f;
    T laz;
    signed par, cnt, nxt[2];
    Node() {}
    Node(bool f, Int par) : f(f), laz(0), par(par), cnt(0) {
      nxt[0] = nxt[1] = -1;
    }
  };
  const Int lim = 7e6;
  Int idx;
  vector<Node> v;
  BinaryTrie() : idx(0), v(lim) { emplace(0, -1); }
  void emplace(bool f, Int par) {
    if (idx > lim)
      while (1)
        ;
    v[idx++] = Node(f, par);
  }
  void rebuild() {
    vector<T> vs;
    vector<Int> vc;
    T a = val(xmin(0));
    Int pos = find(a);
    vs.emplace_back(a);
    vc.emplace_back(v[pos].cnt);
    while (val(xmax(0)) != a) {
      pos = next(pos);
      a = val(pos);
      vs.emplace_back(a);
      vc.emplace_back(v[pos].cnt);
    }
    idx = 0;
    emplace(0, -1);
    for (Int i = 0; i < (Int)vs.size(); i++)
      for (Int j = 0; j < vc[i]; j++) add(vs[i]);
  }
  inline Int count(Int x) { return x < 0 ? 0 : v[x].cnt; }
  inline void eval(Int i, Int x) {
    if ((v[x].laz >> i) & 1) {
      swap(v[x].nxt[0], v[x].nxt[1]);
      v[x].laz ^= T(1) << i;
    }
    for (Int k = 0; k < 2; k++) {
      if (!~v[x].nxt[k]) continue;
      v[v[x].nxt[k]].laz ^= v[x].laz;
      v[v[x].nxt[k]].f = k;
    }
    v[x].laz = 0;
  }
  void add(const T b) {
    Int pos = 0;
    for (Int i = X - 1; i >= 0; i--) {
      eval(i, pos);
      bool f = (b >> i) & 1;
      if (~v[pos].nxt[f]) {
        pos = v[pos].nxt[f];
        continue;
      }
      Int npos = idx;
      v[pos].nxt[f] = npos;
      emplace(f, pos);
      pos = npos;
    }
    if (val(pos) != b) cout << pos << " " << b << ":" << val(pos) << endl;
    assert(val(pos) == b);
    v[pos].cnt++;
    for (Int i = 0; i < X; i++) {
      pos = v[pos].par;
      v[pos].cnt = count(v[pos].nxt[0]) + count(v[pos].nxt[1]);
    }
  }
  void update(const T b) { v[0].laz ^= b; }
  Int find(const T b) {
    Int pos = 0;
    for (Int i = X - 1; i >= 0; i--) {
      eval(i, pos);
      bool f = (b >> i) & 1;
      if (~v[pos].nxt[f])
        pos = v[pos].nxt[f];
      else
        return -1;
    }
    return pos;
  }
  void erase(Int pos) {
    if (pos < 0)
      while (1)
        ;
    v[pos].cnt--;
    for (Int i = 0; i < X; i++) {
      pos = v[pos].par;
      v[pos].cnt = count(v[pos].nxt[0]) + count(v[pos].nxt[1]);
      for (Int k = 0; k < 2; k++)
        if (!count(v[pos].nxt[k])) v[pos].nxt[k] = -1;
    }
  }
  Int xmax(const T b) {
    Int pos = 0;
    for (Int i = X - 1; i >= 0; i--) {
      eval(i, pos);
      bool f = (~b >> i) & 1;
      f ^= !~v[pos].nxt[f];
      pos = v[pos].nxt[f];
    }
    return pos;
  }
  Int xmin(const T b) { return xmax(~b & ((T(1) << X) - 1)); }
  Int next(Int pos) {
    for (Int i = -1; i < X; i++) {
      Int par = v[pos].par;
      if (v[pos].f == 0 && ~v[par].nxt[1]) return fmin(i, v[par].nxt[1]);
      pos = par;
    }
    while (1)
      ;
    return pos;
  }
  Int fmin(Int i, Int pos) {
    if (i == -1) return pos;
    eval(i, pos);
    return fmin(i - 1, v[pos].nxt[v[pos].nxt[0] == -1]);
  }
  T val(Int pos) {
    if (pos < 0)
      while (1)
        ;
    T res = 0;
    for (Int i = 0; i < X; i++) {
      res |= T(v[pos].f) << i;
      pos = v[pos].par;
    }
    return res;
  }
  void show() {
    vector<Int> vs;
    Int a = val(xmin(0));
    vs.emplace_back(a);
    Int pos = find(a);
    while (val(xmax(0)) != a) {
      pos = next(pos);
      a = val(pos);
      vs.emplace_back(a);
    }
    cout << "#######" << endl;
    for (Int x : vs) cout << x << " ";
    cout << endl;
  }
};
signed main() {
  Int n;
  scanf("%lld", &n);
  vector<Int> b(n);
  for (Int i = 0; i < n; i++) scanf("%lld", &b[i]);
  BinaryTrie<Int, 60> bt;
  for (Int i = 0; i < n; i++) bt.add(b[i]);
  Int z = 0;
  auto apply = [&](Int a) {
    z ^= a;
    bt.update(a);
  };
  vector<Int> ans;
  Int x = bt.val(bt.xmin(0));
  ans.emplace_back(x);
  bt.erase(bt.find(x));
  apply(x);
  for (Int i = 1; i < n; i++) {
    bt.add(x);
    Int pos = bt.find(x);
    if (bt.val(bt.xmax(0)) == x) {
      printf("No\n");
      return 0;
    }
    Int nxt = bt.next(pos);
    Int y = bt.val(nxt);
    ans.emplace_back(y ^ z);
    bt.erase(pos);
    bt.erase(nxt);
    apply(x ^ y);
    x = y;
    if (bt.idx + 1000 >= bt.lim) bt.rebuild();
  }
  printf("Yes\n");
  for (Int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%lld", ans[i]);
  }
  printf("\n");
  return 0;
}
