def calc(N, A):
    _exist = False
    if (N % 3 == 0):
        A.sort()
        m = N // 3
        _exist = A.count(A[0]) == m and A.count(
            A[m]) == m and A.count(A[m * 2]) == m and A[m * 2] == A[0] ^ A[m]
    print('Yes' if _exist else 'No')


N = int(input())
A = [int(s) for s in input().split(' ')]
calc(N, A)
