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) == 2:
    if n%3 != 0:
        print("No")
    elif 0 in d:
        flag = True
        for key in d.keys():
            if key == 0:
                if not d[key] == n//3:
                    flag = False
            else:
                if not d[key] == 2*n//3:
                    flag=False
        if flag:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

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

else:
    if n % 3 != 0:
        print("No")
    else:
        tartar = [0,0,0]
        num = [0,0,0]
        temp = 0
        for key in d.keys():
            tartar[temp] = key
            num[temp] = d[key]
            temp+=1
        if not (num[0] == num[1] and num[1] == num[2]):
            print("No")
        else:
            tar2 = [
                [tartar[0], tartar[1], tartar[2]],
                [tartar[0], tartar[2], tartar[1]],
                [tartar[1], tartar[0], tartar[2]],
                [tartar[1], tartar[2], tartar[0]],
                [tartar[2], tartar[1], tartar[0]],
                [tartar[2], tartar[0], tartar[1]],

            ]
            flag = False
            for tar in tar2:
                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]:
                    flag = True
            if flag:
                print("Yes")
            else:
                print("No")
