def check(b, l):
    for i in l:
        if b == i:
            continue
        #print(b ^ i)
        if not((b ^ i) in l):
            print("No")
            exit()
    
    print("Yes")
    exit()

n = int(input())
lst = list(map(int, input().split()))
x = lst

base = x[0]
check(base, x)