import sys

n = int(input())
arr = list(map(int, input().split()))

if all([x == 0 for x in arr]):
    print("Yes")
    sys.exit()

if n % 3 != 0:
    print("No")
    sys.exit()

# 排他的論理和になっているか
ans1 = arr[0] == arr[1] ^ arr[2] and arr[1] == arr[0] ^ arr[2] and arr[2] == arr[0] ^ arr[1]

# 3つずつ循環しているか
ans2 = all([x == arr[0] for x in arr[0::3]]) and all([x == arr[1] for x in arr[1::3]]) and all([x == arr[2] for x in arr[2::3]])

print("Yes" if ans1 and ans2 else "No")