N = int(input()) A = list(map(int,input().split())) num = min(N, 22) from collections import defaultdict dic = defaultdict(list) for i in range(1,1<>j)&1 == 1: temp += A[j] dic[temp].append(i) #print(dic) def overlap(p,q): for i in range(30): if (p>>i)&1 == 1 and (q>>i)&1 == 1: return False return True ret = [0]*N for x in range(2*pow(10,7)): if len(dic[x]) <= 1: continue n = len(dic[x]) for i in range(n): a = dic[x][i] for j in range(i+1,n): b = dic[x][j] if not overlap(a,b): continue for s in range(30): if (a>>s)&1 == 1: ret[s] = A[s] if (b>>s)&1 == 1: ret[s] = -A[s] Flag = 0 if (a>>s)&1 == 1 and (b>>s)&1 == 1: Flag = 1 assert Flag == 0 print("Yes") print(*ret); exit() print("No")