from random import randrange from time import time def ra(a, b): la = a.bit_length() lb = b.bit_length() while 1: i = randrange(-1, min(la, lb)) c = a ^ b if i < 0 else a ^ b ^ (1 << i) ^ randrange(1 << i) if chk(a, b, c): return c def chk(a, b, c): if a ^ b <= c and b ^ c <= a and c ^ a <= b: return 1 return 0 N = int(input()) NN = 1 << N A = [int(a) for a in input().split()] if A[0] < 0: A[0] = 0 if N == 1: if A[1] < 0: A[1] = 0 print("Yes") print(*A) exit() ng = 0 B = [max(a, 0) for a in A] for i in range(NN): for j in range(NN): if B[i] ^ B[j] > B[i^j]: if A[i] >= 0 and A[j] >= 0 and A[i^j] >= 0: print("No") exit() ng += 1 sTime = time() while ng and time() - sTime < 1.5: i = randrange(NN) if A[i] >= 0: continue j = 0 while j == 0 or i == j: j = randrange(NN) c = ra(B[j], B[i^j]) while 1: pre = 0 new = 0 for j in range(NN): if chk(c, B[j], B[i^j]) == 0: new += 10000 if A[j] >= 0 and A[i^j] >= 0 else 1 if chk(B[i], B[j], B[i^j]) == 0: pre += 10000 if A[j] >= 0 and A[i^j] >= 0 else 1 if new <= pre + 1: B[i] = c ng += new - pre break c = ra(B[j], B[i^j]) if ng: print("No") else: print("Yes") print(*B)