N=int(input())
A=list(map(int,input().split()))

from collections import Counter

c=Counter(A)

if len(c)!=3:
    print("No")
    exit()

n=list(c.keys())


if n[0]|n[1]==n[2]:
    print("Yes")
else:
    print("No")