import sys

if __name__ == '__main__':
    N = int(input())
    A = InputToInt()
    if N%3 != 0:
        print('No')
        sys.exit()
    A.sort()

    n = N/3
    if 1 == len(set(A[0:n])) and 1 == len(set(A[n:2*n])) and 1 == len(set(A[2*n:3*n])) and A[0] == A[n] ^ A[2*n]:
        print('Yes')
    else:
        print('No')
