def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def solve(N, A):
    A = sorted(A)
    xor_a = 0

    if N % 3 == 0:
        if A[0] == 0:
            for i in range(N//3):
                if A[i] != 0:
                    return 0
            for i in range(N//3, N):
                if A[i] != A[N//3]:
                    return 0
            return 1
        else:
            for i in range(N//3):
                if A[i] != A[0]:
                    return 0
            for i in range(N // 3, 2 * N // 3):
                if A[i] != A[N // 3]:
                    return 0
            for i in range(2 * N // 3, N):
                if A[i] != A[2 * N // 3]:
                    return 0
            for i in range(N):
                xor_a ^= A[i]
            return 1 if xor_a == 0 else 0
    else:
        return 0


if __name__ == '__main__':
    inputs = read()
    print('Yes' if solve(*inputs) else 'No')
