import collections, itertools
N = int(input())
A = [int(_) for _ in input().split()]
C = sorted(collections.Counter(A).most_common(), key=lambda xs: -xs[1])
f = 0
if len(C) == 1:
    a, la = C[0]
    #a^a^a^
    if a ^ a == a:
        f = 1
elif len(C) == 2:
    a, la = C[0]
    b, lb = C[1]
    #a^b^a^b^a^b^a^
    if la == lb + 1 and a ^ b == a and b ^ a == b == a:
        f = 1
    #a^b^a^b^a^b^
    if la == lb and a ^ b == a and b ^ a == b:
        f = 1
elif len(C) == 3:
    a, la = C[0]
    b, lb = C[1]
    c, lc = C[2]
    #x^y^(x^y)^x^y^(x^y)^
    if la == lb == lc and any(
            x ^ y == z for x, y, z in itertools.permutations((a, b, c))):
        f = 1
    #x^y^(x^y)^x^y^
    if la == lb == lc + 1:
        if any(x ^ y == c == x and y ^ c == x and c ^ x == y
               for x, y in ((a, b), (b, a))):
            f = 1
    #(y^z)^y^z^(y^z)^y^z^(y^z)^
    if lb == lc == la - 1:
        if any(a ^ y == z and y ^ z == a and z ^ a == y == a
               for y, z in ((b, c), (c, b))):
            f = 1
if f:
    print('Yes')
else:
    print('No')
