import operator
n = int(input())
a = [int(x) for x in input().split()]
a = sorted(a)

isTrue = False

if n == 4:
    if a[0] == 0 and a[1] == 0 and a[2] == a[3] and operator.xor(a[2], a[3]) == 0:
        isTrue = True
elif n % 3 == 0:
    m = int(n / 3)
    m0 = len(set(a[0:m]))
    m1 = len(set(a[m:m*2]))
    m2 = len(set(a[m*2:m*3]))
    if m0 == 1 and m1 == 1 and m2 == 1:
        if operator.xor(a[0], a[1]) == a[2]:
            isTrue = True
        elif operator.xor(a[1], a[2]) == a[0]:
            isTrue = True
        elif operator.xor(a[2], a[0]) == a[1]:
            isTrue = True
if isTrue:
    print("Yes")
else:
    print("No")
