inNum = int(input())

intArr = []

for x in input().split(' '):
    intArr.append(int(x))
myBool = False
for x in range(len(intArr)-1):
    if(0== intArr.count(intArr[x]^intArr[x+1])):
        print("No")
        break
    elif(x == len(intArr)-2):
        print("Yes")