n = int(input())
a = list(map(int,input().split()))
sw = 0
for i in range(n):
    if i == 0:
        t = a[1]^a[-1]
    elif i == n-1:
        t = a[n-2]^a[0]
    else:
        t = a[i-1]^a[i+1]
    if t == a[i]:
        sw = 1
        break
print(["No","Yes"][sw])