import sys

N = int(input())
a = list(map(int, input().split()))
a.sort()
a.append(a[0])

for i in range(N):
    if i == 0:
        if bin(a[N-1] ^ a[i+1]) == bin(a[i]):
            continue
        else:
            print("No")
            sys.exit()

    else:
        if bin(a[i-1] ^ a[i+1]) == bin(a[i]):
            continue
        else:
            print("No")
            sys.exit()
print("Yes")