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;
const int N = 1e5 + 7;
const int LEN = N * 61;
int go[LEN][2];
int cnt[LEN];
int sz = 1;
void add(long long x) {
  int v = 0;
  for (int i = 60; i >= 0; i--) {
    int c = ((x >> i) & 1);
    if (!go[v][c]) {
      go[v][c] = sz++;
    }
    v = go[v][c];
    cnt[v]++;
  }
}
void rem(long long x) {
  int v = 0;
  for (int i = 60; i >= 0; i--) {
    int c = ((x >> i) & 1);
    if (!go[v][c]) {
      go[v][c] = sz++;
    }
    v = go[v][c];
    cnt[v]--;
  }
}
long long get(long long x, int v = 0, int lg = 60, long long cur = 0,
              bool lol = false) {
  if (lg < 60 && (v == 0 || !cnt[v])) return -1;
  if (lg == -1) return cur;
  int i = lg;
  long long x1 = x + 1;
  int go0 = 0;
  int go1 = 1;
  if (x >> i & 1) swap(go1, go0);
  int mem = go0;
  if ((x1 >> i & 1) && !lol) mem = go1;
  if (mem == go0 && (go[v][mem] == 0 || !cnt[go[v][mem]]))
    mem = go1, lol = true;
  long long cur1 = cur + mem * (1LL << i);
  long long ans = get(x, go[v][mem], lg - 1, cur1, lol);
  if (ans == -1 && mem == go0)
    mem = go1, ans = get(x, go[v][mem], lg - 1, cur + mem * (1LL << i), true);
  return ans;
}
bool fast(vector<long long> a) {
  int n = a.size();
  fill(cnt, cnt + LEN, 0);
  sz = 1;
  for (int i = 0; i < LEN; ++i) go[i][0] = go[i][1] = 0;
  sort(a.begin(), a.end());
  long long cur = a[0];
  vector<bool> used(n);
  used[0] = true;
  for (int i = 1; i < n; ++i) {
    add(a[i]);
  }
  vector<long long> ans;
  ans.push_back(a[0]);
  for (int i = 0; i < n - 1; ++i) {
    long long mem = get(cur);
    if (mem == -1) {
      cout << "No\n";
      return false;
    }
    cur ^= mem;
    ans.push_back(mem);
    rem(mem);
  }
  cout << "Yes\n";
  for (auto& x : ans) cout << x << ' ';
  cout << '\n';
  return true;
}
bool stupid(vector<long long> b) {
  sort(b.begin(), b.end());
  do {
    bool bad = false;
    vector<long long> c = b;
    for (int i = 1; i < (int)b.size(); i++) {
      c[i] ^= c[i - 1];
      if (c[i] <= c[i - 1]) {
        bad = true;
        break;
      }
    }
    if (!bad) {
      return true;
    }
  } while (next_permutation(b.begin(), b.end()));
  return false;
}
int main1() {
  srand(time(0));
  for (int i = 0; i < 1000; ++i) {
    int n = 5;
    vector<long long> a(n);
    for (auto& x : a) x = rand() % 10;
    if (fast(a) != stupid(a)) {
      cerr << n << '\n';
      for (auto& x : a) cerr << x << ' ';
      cerr << "fail\n";
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  fast(a);
  return 0;
}
