#Xor circle
n=int(input())
lists=list(map(int,input().split()))
lists.append(lists[0])
flag=True
for i in range(1,n):
    if lists[i-1]^lists[i+1]!=lists[i]:
        flag=False
        break
if flag:
    print("Yes")
else:
    print("No")