n = int(input())
A = list(map(int,input().split()))

def a():
    if n%3 > 0:
        if len(list(set(A))) == 1:
            return "Yes"
    else:
        B = list(set(A))
        if len(B) <= 3:
            c = 0
            t = 0
            for i in B:
                cou = A.count(i)
                if cou % (n//3) == 0:
                    c += 1
                    for i in range(cou // (n//3)):
                        t ^= i
            if c == len(B) and t == 0:
                return "Yes"
    return "No"

print(a())