from collections import Counter
import sys

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

# 全て0ならYes
if all([x == 0 for x in arr]):
    print("Yes")
    sys.exit()

# 3つずつ循環していなければNo
if n % 3 != 0:
    print("No")
    sys.exit()

c = Counter(arr)

if len(c) == 2:
    if c[0] == n // 3:
        ans1 = True
    else:
        ans1 = False
elif len(c) == 3:
    ans1 = True
else:
    ans1 = False

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

# 3つずつ循環しているか
ans3 = 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 and ans3 else "No")