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