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 long long int inf = 1000000000;
const long long int mod = 1000000000 + 7;
inline void IO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
inline int dcmp(long double x) { return x < -1e-12 ? -1 : (x > 1e-12); }
template <class T>
inline int CHECK(T MASK, int i) {
  return (MASK >> i) & 1;
}
template <class T>
inline T ON(T MASK, int i) {
  return MASK | (T(1) << i);
}
template <class T>
inline T OFF(T MASK, int i) {
  return MASK & (~(T(1) << i));
}
template <typename T>
inline int CNT(T MASK) {
  if (numeric_limits<T>::digits <= numeric_limits<unsigned int>::digits)
    return __builtin_popcount(MASK);
  else
    return __builtin_popcountll(MASK);
}
template <class T>
inline int RIGHT(T MASK) {
  return log2(MASK & -MASK);
}
int dx4[] = {0, 0, -1, +1};
int dy4[] = {+1, -1, 0, 0};
int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
inline void I(int& a) { scanf("%d", &a); }
inline void I(long long int& a) { scanf("%I64d", &a); }
inline void I(unsigned long long int& a) { scanf("%I64u", &a); }
inline void I(char* a) { scanf("%s", a); }
char Iarr[2000010];
inline void I(string& a) {
  scanf("%s", Iarr);
  a = Iarr;
}
template <typename T, typename... Args>
void I(T& a, Args&... args) {
  I(a);
  I(args...);
}
inline void OUT(int a) { printf("%d", a); }
inline void OUT(long long int a) { printf("%I64d", a); }
inline void OUT(const char* a) { printf("%s", a); }
inline void OUT(char* a) { printf("%s", a); }
inline void OUT(bool a) { printf("%d", a); }
inline void OUT(string a) {
  for (__typeof(a.end()) it = (a.begin()) - ((a.begin()) > (a.end()));
       it != (a.end()) - ((a.begin()) > (a.end()));
       it += 1 - 2 * ((a.begin()) > (a.end())))
    printf("%c", *it);
}
inline void OUT(unsigned long long int a) { printf("%I64u", a); }
template <typename T, typename... Args>
void OUT(T a, Args... args) {
  OUT(a);
  OUT(" ");
  OUT(args...);
}
template <typename... Args>
void O(Args... args) {
  OUT(args...);
  OUT("\n");
}
template <typename T1, typename T2>
inline ostream& operator<<(ostream& os, pair<T1, T2> p) {
  os << "{" << p.first << ", " << p.second << "}";
  return os;
}
template <typename T>
inline ostream& operator<<(ostream& os, vector<T>& a) {
  os << "[";
  for (int i = 0; i < (int)a.size(); i++) {
    if (i) os << ", ";
    os << a[i];
  }
  os << "]";
  return os;
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << endl;
  err(++it, args...);
}
const int M = 1000010;
struct Node {
  int childrenCount[2];
  Node* link[2];
  long long int num;
};
Node* root;
Node* getNode() {
  Node* nNode = new Node();
  nNode->childrenCount[0] = nNode->childrenCount[1] = 0;
  nNode->num = 0;
  return nNode;
}
long long int query(long long int X) {
  long long int ret = -1;
  long long int maxx = -1;
  Node* curr = root;
  for (int i = 60; i >= 0; i--) {
    bool f = CHECK(X, i);
    if (f) {
      Node* n = curr;
      if (n->childrenCount[1]) {
        n = n->link[1];
        for (int j = i - 1; j >= 0; j--) {
          f = CHECK(X, j);
          if (n->childrenCount[!f]) {
            n = n->link[!f];
          } else {
            n = n->link[f];
          }
        }
        long long int temp = X ^ n->num;
        if (temp > maxx) {
          maxx = temp;
          ret = n->num;
        }
      }
    }
    if (curr->childrenCount[0]) {
      curr = curr->link[0];
    } else
      break;
  }
  return ret;
}
void inserts(long long int num) {
  Node* curr = root;
  for (int i = 60; i >= 0; i--) {
    bool f = CHECK(num, i);
    if (curr->childrenCount[f]) {
      curr->childrenCount[f]++;
      curr = curr->link[f];
    } else {
      curr->link[f] = getNode();
      curr->childrenCount[f]++;
      curr->link[f]->num = curr->num;
      curr = curr->link[f];
      if (f) curr->num = ON(curr->num, i);
    }
  }
}
void deletes(long long int num) {
  Node* curr = root;
  for (int i = 60; i >= 0; i--) {
    bool f = CHECK(num, i);
    curr->childrenCount[f]--;
    curr = curr->link[f];
  }
}
int main() {
  root = getNode();
  int n;
  I(n);
  long long int a[n];
  long long int X = 0;
  for (int i = 0; i < n; i++) {
    I(a[i]);
    X ^= a[i];
    inserts(a[i]);
  }
  vector<long long int> v;
  for (int i = 0; i < n; i++) {
    long long int ans = query(X);
    if (ans == -1) {
      O("No");
      exit(0);
    } else {
      v.push_back(ans);
      X ^= ans;
      deletes(ans);
    }
  }
  reverse(v.begin(), v.end());
  O("Yes");
  for (int i = 0; i < (int)v.size(); i++) {
    printf("%lld ", v[i]);
  }
  O("");
  return 0;
}
