from collections import deque, defaultdict
from copy import copy

def main():
    N = int(input())
    _ = input().split()
    D_ = defaultdict(int)
    a_line = []
    for i, a in enumerate(_):
        a_ = int(a)
        D_[a_] += 1
        if i == 0:
            start = a_
            D_[start] -= 1
        a_line += [a_]

    if len(D_) >= 4:
        print('No')
        return

    Q = []
    for a in a_line:
        D = copy(D_)
        D[a] -= 1
        Q += [(start, a, D, N-2)]
    Q = deque(Q)

    while len(Q):
        a, b, D, count = Q.popleft()
        c = a ^ b
        d_ = D.get(c, None)
        if d_ is None or d_ == 0:
            continue
        D[d_] -= 1
        count -= 1
        if count == 0:
            print('Yes')
            return
        Q.append((b, c, D, count))

    print('No')
    return

if __name__ == '__main__':
    main()
