a=int(input())
li = list(map(int,input().split()))	
flag = True
if (a != len(li)):
    flag = False

if (li[a-1] ^ li[1] != li[0] ):
    flag = False

for i in range(1,a-1):
    if ((li[i-1] ^ li[i+1]) != li[i] ):
        flag = False
        break

if flag :
    print("Yes")
else :
    print("No")