import numpy as np

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

for a in arr:
    if a not in d:
        d[a] = 1

if len(d) != 3:
    print("No")
else:
    if n % 3 != 0:
        print("No")
    else:
        tar = [0,0,0]
        temp = 0
        for key in d.keys():
            tar[temp] = key
            temp+=1
        x1 = tar[0]^tar[1]
        x2 = tar[1]^tar[2]
        x3 = tar[0]^tar[2]

        if x1 == tar[2] and x2 == tar[0] and x3== tar[1]:
            print("Yes")
        else:
            print("No")
