n = int(input())
a_lists = list(input().split())

cnt = 0
for i in range(int(n)):
    for j in range(i+1,int(n)-1):
        if int(a_lists[i]) != int(a_lists[j]) ^ int((a_lists[j+1])):
            print("No")
            exit()
print("Yes")
