def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    A_c = [[i,j] for i,j in Counter(A).items()]
    A_s = {A_c[i][0] for i in range(len(A_c))}
    cnt = 1
    l = [A_c[0][0]]
    A_c[0][1] -= 1
    if A_c[0][1] == 0: A_s.discard(A_c[0][0])
    next = l[-1] ^ A_c[-1][0]
    i = 1
    while len(l) < N:
        if next in A_s:
            l.append(A_c[-i][0])
            A_c[-i][1] -= 1
            i = 1
        else:
            i += 1
            if len(A_c) < i:
                break
        next = l[-1] ^ A_c[-i][0]
    else:
        print("Yes")
    for i in range(N-2):
        if A[i] ^ A[i+1] != A[i+2]:
            print("No")
            break
    else:
        if A[N-2] ^ A[N-1] == A[0] and A[N-1] ^ A[0] == A[1]:
            return print("Yes")
        else:
            pass
            print("No")
if __name__ == '__main__':
    main()