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