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
    else:
        d[a] += 1
if len(d) == 1:
    if 0 in d:
        print("Yes")

elif len(d) != 3:
    print("No")

else:
    if n % 3 != 0:
        print("No")
    else:
        tar = [0,0,0]
        num = [0,0,0]
        temp = 0
        for key in d.keys():
            tar[temp] = key
            num[temp] = d[key]
            temp+=1
        if not (num[0] == num[1] and num[1] == num[2]):
            print("No")
        else:
            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")
