import sequtils,strutils,algorithm
var
    N = stdin.readline.parseInt
    A = stdin.readline.split.map(parseInt)
    
A.sort(system.cmp)
var nums = newSeq[int](0)

proc count(x : seq[int], i : int) :int =
    for a in x:
        if a == i:
            result += 1


for i, a in A:
    if i == 0:
        nums.add(a)
        continue
    if A[i - 1] != a:
        nums.add(a)
        
if N mod 3 == 0:
    if nums.len == 1:
        if nums[0] == 0:
            echo "Yes"
        else:
            echo "No"
    elif nums.len != 3:
        echo "No"
    elif ((nums[0] xor nums[1] xor nums[2]) == 0 and
        A.count(nums[0]) == A.count(nums[1]) and A.count(nums[1]) == A.count(nums[2])):
        echo "Yes"
    else:
        echo "No"

else:
    if nums[0] == 0 and nums.len == 1:
        echo "Yes"
    else:
        echo "No"
        