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.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.util.Map.Entry;

public class Main
{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;
	private PrintWriter pw;
	private long mod = 1000000000
			+ 7;

	private StringBuilder ans_sb;
	int k = 0;

	private void soln()
	{
		int n = nextInt();
		long[] arr = new long[n];
		long xor = 0;
		Node root = new Node();
		for (int i = 0; i < n; i++)
		{
			long b = nextLong();
			xor ^= b;
			arr[i] = b;
			add(arr[i],
					root);
		}
		root.cnt = 1;
		long[] nb = new long[n];
		long[] nnb = new long[n];
		boolean f = true;
		for (int i = n
				- 1; i >= 0; i--)
		{
			nnb[i] = xor;
			nb[i] = fetch(
					xor,
					root,
					61,
					true);
			if (nb[i] == -1)
			{
				f = false;
				break;
			}
			del(nb[i],
					root,
					61);
			xor ^= nb[i];
		}
		long prev = 0;
		// debug(nb);
		// debug(nnb);
		for (int i = 0; i < n; i++)
		{
			long nn = prev
					^ nb[i];
			if (nn > prev)
			{
				prev = nn;
			} else
			{
				f = false;
				break;
			}
		}
		if (f)
		{
			pw.println(
					"Yes");
			for (int i = 0; i < n; i++)
				pw.print(
						nb[i] + " ");
		} else
		{
			pw.println(
					"No");
		}
	}

	private class Node
	{
		long v;
		int cnt;
		Node l, r;
	}

	private void add(
			long v,
			Node root)
	{
		root.cnt++;
		for (int i = 61; i >= 0; i--)
		{
			long bit = ((v >> i)
					& 1);
			if (bit != 0)
			{
				if (root.r == null)
					root.r = new Node();
				root = root.r;
			} else
			{
				if (root.l == null)
					root.l = new Node();
				root = root.l;
			}
			root.cnt++;
		}
		root.v = v;
	}

	private void del(
			long v,
			Node root,
			int i)
	{
		if (i == -1)
		{
			root.cnt--;
			return;
		}
		long bit = ((v >> i)
				& 1);
		if (bit != 0)
			del(v, root.r,
					i - 1);
		else
			del(v, root.l,
					i - 1);
		if (root.r != null
				&& root.r.cnt == 0)
			root.r = null;
		if (root.l != null
				&& root.l.cnt == 0)
			root.l = null;
		root.cnt--;
	}

	private long fetch(
			long v,
			Node root,
			int i,
			boolean f)
	{
		if (i == -1)
		{
			return root.v;
		}
		long ret = -1;
		long bit = ((v >> i)
				& 1);
		if (f)
		{
			if (bit != 0)
			{
				if (root.l == null)
					ret = fetch(
							v,
							root.r,
							i - 1,
							!f);
				else
				{
					ret = fetch(
							v,
							root.l,
							i - 1,
							f);
					if (ret == -1
							&& root.r != null)
						ret = fetch(
								v,
								root.r,
								i - 1,
								!f);
				}
			} else
			{
				if (root.l == null)
					return -1;
				else
					ret = fetch(
							v,
							root.l,
							i - 1,
							f);
			}
		} else
		{
			if (bit != 0)
			{
				if (root.l == null)
					ret = fetch(
							v,
							root.r,
							i - 1,
							f);
				else
					ret = fetch(
							v,
							root.l,
							i - 1,
							f);
			} else
			{
				if (root.r == null)
					ret = fetch(
							v,
							root.l,
							i - 1,
							f);
				else
					ret = fetch(
							v,
							root.r,
							i - 1,
							f);
			}
		}
		return ret;
	}

	private String solveEqn(
			long a,
			long b)
	{
		long x = 0,
				y = 1,
				lastx = 1,
				lasty = 0,
				temp;
		while (b != 0)
		{
			long q = a
					/ b;
			long r = a
					% b;
			a = b;
			b = r;
			temp = x;
			x = lastx
					- q * x;
			lastx = temp;
			temp = y;
			y = lasty
					- q * y;
			lasty = temp;
		}
		return lastx
				+ " "
				+ lasty;
	}

	private void debug(
			Object... o)
	{
		System.out
				.println(
						Arrays.deepToString(
								o));
	}

	private long pow(
			long a,
			long b,
			long c)
	{
		if (b == 0)
			return 1;
		long p = pow(
				a,
				b / 2,
				c);
		p = (p * p)
				% c;
		return (b
				% 2 == 0)
						? p
						: (a * p)
								% c;
	}

	private long gcd(
			long n,
			long l)
	{
		if (l == 0)
			return n;
		return gcd(
				l,
				n % l);
	}

	public static void main(
			String[] args)
			throws Exception
	{
		new Thread(
				null,
				new Runnable()
				{
					@Override
					public void run()
					{
						new Main()
								.solve();
					}
				},
				"1",
				1 << 26).start();
		// new Main().solve();
	}

	public StringBuilder solve()
	{
		InputReader(
				System.in);
		/*
		 * try { InputReader(new FileInputStream("C:\\Users\\hardik\\Desktop\\in.txt"));
		 * } catch(FileNotFoundException e) {}
		 */
		pw = new PrintWriter(
				System.out);
		// ans_sb = new StringBuilder();
		soln();

		pw.close();
		// System.out.println(ans_sb);
		return ans_sb;
	}

	public void InputReader(
			InputStream stream1)
	{
		stream = stream1;
	}

	private boolean isWhitespace(
			int c)
	{
		return c == ' '
				|| c == '\n'
				|| c == '\r'
				|| c == '\t'
				|| c == -1;
	}

	private boolean isEndOfLine(
			int c)
	{
		return c == '\n'
				|| c == '\r'
				|| c == -1;
	}

	private int read()
	{
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars)
		{
			curChar = 0;
			try
			{
				numChars = stream
						.read(buf);
			} catch (IOException e)
			{
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	private int nextInt()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		int sgn = 1;
		if (c == '-')
		{
			sgn = -1;
			c = read();
		}
		int res = 0;
		do
		{
			if (c < '0'
					|| c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(
				c));
		return res
				* sgn;
	}

	private long nextLong()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		int sgn = 1;
		if (c == '-')
		{
			sgn = -1;
			c = read();
		}
		long res = 0;
		do
		{
			if (c < '0'
					|| c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(
				c));
		return res
				* sgn;
	}

	private String nextToken()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		StringBuilder res = new StringBuilder();
		do
		{
			res.appendCodePoint(
					c);
			c = read();
		} while (!isSpaceChar(
				c));
		return res
				.toString();
	}

	private String nextLine()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		StringBuilder res = new StringBuilder();
		do
		{
			res.appendCodePoint(
					c);
			c = read();
		} while (!isEndOfLine(
				c));
		return res
				.toString();
	}

	private int[] nextIntArray(
			int n)
	{
		int[] arr = new int[n];
		for (int i = 0; i < n; i++)
		{
			arr[i] = nextInt();
		}
		return arr;
	}

	private long[] nextLongArray(
			int n)
	{
		long[] arr = new long[n];
		for (int i = 0; i < n; i++)
		{
			arr[i] = nextLong();
		}
		return arr;
	}

	private void pArray(
			int[] arr)
	{
		for (int i = 0; i < arr.length; i++)
		{
			System.out
					.print(arr[i]
							+ " ");
		}
		System.out
				.println();
		return;
	}

	private void pArray(
			long[] arr)
	{
		for (int i = 0; i < arr.length; i++)
		{
			System.out
					.print(arr[i]
							+ " ");
		}
		System.out
				.println();
		return;
	}

	private boolean isSpaceChar(
			int c)
	{
		if (filter != null)
			return filter
					.isSpaceChar(
							c);
		return isWhitespace(
				c);
	}

	private char nextChar()
	{
		int c = read();
		while (isSpaceChar(
				c))
			c = read();
		char c1 = (char) c;
		while (!isSpaceChar(
				c))
			c = read();
		return c1;
	}

	private interface SpaceCharFilter
	{
		public boolean isSpaceChar(
				int ch);
	}
}