import sys
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    if i==0:
        if a[n-1]^a[1] != a[0]:
            print("No")
            sys.exit()
    elif 0 < i < n-1:
        if a[i-1]^a[i+1] != a[i]:
            print("No")
            sys.exit()
    elif i == n-1:
        if a[n-2]^a[0] != a[n-1]:
            print("No")
            sys.exit()
print("Yes")