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.
import java.io.*;
import java.util.*;

public class E implements Runnable{
	public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();}

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		int n = fs.nextInt();
		long[] a = new long[n];
		for(int i = 0; i < n; i++) a[i] = fs.nextLong();
		int max = 100100 * 60;
		int[][] trie = new int[2][max];
		int[] freq = new int[max];
		int idx = -1;
		int nc = 1;
		for(int i = 0; i < n; i++) {
			if(idx == -1 || a[idx] > a[i]) idx = i;
			int at = 0;
			for(int bit = 60; bit >= 0; bit--) {
				long on = (1L << bit) & a[i];
				if(on == 0) {
					if(trie[0][at] == 0) trie[0][at] = nc++;
					at = trie[0][at];
					freq[at]++;
				}
				else {
					if(trie[1][at] == 0) trie[1][at] = nc++;
					at = trie[1][at];
					freq[at]++;
				}
			}
		}
		
		long[] res = new long[n];
		res[0] = a[idx];
		remove(trie, freq, a[idx]);
		long cur = a[idx];
		for(int i = 0; i < n - 1; i++) {
//			System.out.println("Cur " + cur + " s " + Arrays.toString(res));
			boolean found = false;
			//find smallest number to make me bigger
			for(int off = 60; off >= 0; off--) {
				boolean works = true;
				long num = 0;
				int cnt = 0;
				int at = 0;
				for(int bit = 60; bit >= 0; bit--) {
					if(cnt < off) {
						//take 0
						if(trie[0][at] == 0 || freq[trie[0][at]] == 0) { works = false; break; }
						at = trie[0][at];
						cnt++;
					}
					else {
//						System.out.println(off + " " + bit);
						int me = ((1L << bit) & (cur)) > 0 ? 1 : 0;
						if(trie[me^1][at] != 0 && freq[trie[me^1][at]] > 0) {
//							System.out.println("Here");
							if(me == 0) num |= (1L << bit);
							at = trie[me^1][at];
						}
						else if(trie[me][at] != 0 && freq[trie[me][at]] > 0) {
//							System.out.println("Here2");
							if(me == 1) num |= (1L << bit);
							at = trie[me][at];
						}
						else {
							works = false;
							break;
						}
					}
				}
				if(!works) continue;
//				System.out.println("Off " + off + " " + num + " " + works);
				if((cur^num) > cur) {
					res[i + 1] = num;
					found = true;
					remove(trie, freq, num);
					cur ^= num;
					break;
				}
			}
			if(!found) {
				System.out.println("No");
				return;
			}
		}
		
		out.println("Yes");
		for(int i = 0; i < n; i++) out.print(res[i] + " ");

		out.close();
	}
	
	boolean contains(int[][] trie, int[] freq, long v) {
		int at = 0;
		for(int bit = 60; bit >= 0; bit--) {
			long on = (1L << bit) & v;
			if(on > 0) {
				if(trie[1][at] == 0 || freq[trie[1][at]] == 0) return false;
				at = trie[1][at];
			}
			else {
				if(trie[0][at] == 0 || freq[trie[0][at]] == 0) return false;
				at = trie[0][at];
			}
		}
		return true;
	}
	
	void remove(int[][] trie, int[] freq, long v) {
		int at = 0;
		for(int bit = 60; bit >= 0; bit--) {
			long on = (1L << bit) & v;
			if(on == 0) {
				at = trie[0][at];
			}
			else {
				at = trie[1][at];
			}
			freq[at]--;
		}
	}

	void sort (int[] a) {
		int n = a.length;
		for(int i = 0; i < 50; i++) {
			Random r = new Random();
			int x = r.nextInt(n), y = r.nextInt(n);
			int temp = a[x];
			a[x] = a[y];
			a[y] = temp;
		}
		Arrays.sort(a);
	}

	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}