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("Yes")
            break
        else:
            print("No")
            break
    elif i==n-1:
        if a[0]^a[n-2]==a[n-1]:
            print("Yes")
            break
        else:
            print("No")
            break
    else:
        if a[i-1]^a[i+1]==a[i]:
            print("Yes")
            break
        else:
            print("No")
            break