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

for ai in range(len(An)):
    post_index = ai + 1 if ai + 1 <= len(An) - 1 else 0
    pre = An[ai - 1]
    post = An[post_index]
    if (pre ^ post) != An[ai]:
        print("No")
        exit(0)

print("Yes")