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;
template <typename T>
inline bool uax(T &x, T y) {
  return (y > x) ? x = y, true : false;
}
template <typename T>
inline bool uin(T &x, T y) {
  return (y < x) ? x = y, true : false;
}
string to_string(char c) { return "'" + string(1, c) + "'"; }
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
template <typename A>
string to_string(A);
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ": " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool f = false;
  string r = "{";
  for (auto x : v) {
    if (f) r += ", ";
    r += to_string(x);
    f = true;
  }
  return r += "}";
}
template <typename A>
string to_string(vector<vector<A>> v) {
  string r;
  for (auto x : v) r += "\n" + to_string(x);
  return r;
}
void err(istream_iterator<string>) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << to_string(a) << "; ";
  err(++it, args...);
}
template <typename T>
void kek(T ans) {
  cout << ans << endl;
  exit(0);
}
int const MOD = 1e9 + 7;
long long const INF = 1e18 + 42;
struct trie {
  int cnt;
  vector<trie *> go;
  trie() : cnt(0), go(2, nullptr){};
};
const int M = 62;
trie *t;
void put(long long x) {
  trie *cur = t;
  cur->cnt++;
  for (int i = M; i >= 0; --i) {
    int b = x >> i & 1;
    if (!cur->go[b]) cur->go[b] = new trie();
    cur = cur->go[b];
    cur->cnt++;
  }
}
void del(long long x) {
  auto cur = t;
  cur->cnt--;
  for (int i = M; i >= 0; --i) {
    cur = cur->go[x >> i & 1];
    cur->cnt--;
  }
}
long long ask(long long x) {
  auto cur = t, temp = t;
  int p = -1;
  for (int i = M; i > 0; --i) {
    if (cur->go[0] && cur->go[0]->cnt) {
      cur = cur->go[0];
      if ((x >> (i - 1) & 1LL) && cur->go[1] && cur->go[1]->cnt) {
        p = i;
        temp = cur->go[1];
      }
    } else {
      break;
    }
  }
  if (p == -1) kek("No");
  long long res = 1LL << (p - 1);
  cur = temp;
  for (int i = p - 2; i >= 0; --i) {
    long long b = (x >> i & 1LL) ^ 1;
    if (cur->go[b] && cur->go[b]->cnt) {
      res |= b << i;
      cur = cur->go[b];
    } else {
      assert(cur->go[!b]->cnt);
      res |= (b ^ 1) << i;
      cur = cur->go[b ^ 1];
    }
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  t = new trie();
  int n;
  cin >> n;
  vector<long long> a(n, -1);
  long long xr = 0;
  for (auto &x : a) {
    cin >> x, xr ^= x, put(x);
  }
  a[n - 1] = xr;
  for (int i = n - 2; i >= 0; --i) {
    long long x = ask(a[i + 1]);
    a[i] = x ^ a[i + 1];
    del(x);
  }
  cout << "Yes\n";
  cout << a[0] << ' ';
  for (int i = 1; i < n; ++i) {
    cout << (a[i] ^ a[i - 1]) << ' ';
  }
  cout << '\n';
}
