import sys, collections
sys.setrecursionlimit(10000000)
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", \
    "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

def solve():
    input = sys.stdin.readline
    mod = 7 + 10 ** 9
    N = int(input())
    A = [int(a) for a in input().split()]
    if len(set(A)) > 3: print("No")
    elif len(set(A)) == 3:
        B = list(set(A))
        count = [0, 0, 0]
        for a in A:
            if a == B[0]: count[0] += 1
            elif a == B[1]: count[1] += 1
            else: count[2] += 1
        if count[0] == count[1] and count[1] == count[2] and B[0] ^ B[1] == B[2]: print("Yes")
        else: print("No")
    elif len(set(A)) == 2:
        if 0 not in A: print("No")
        else:
            A.sort()
            if A[N//2] == 0: print("No")
            else: print("Yes")
    else:
        if A[0] == 0: print("Yes")
        else: print("No")

    return 0

if __name__ == "__main__":
    solve()