N=int(input())
a=list(map(int,input().split()))

flag=True
for i in range(N):
    if i==0:
        if a[-1]^a[i]^a[i+1]!=0:
            flag=False
            break
    elif i==N-1:
        if a[i-1]^a[i]^a[0]!=0:
            flag=False
            break
    else:
        if a[i-1]^a[i]^a[i+1]!=0:
            flag=False
            break

print('Yes' if flag else 'No')