import collections
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 ^ a == b and b ^ b == a and b ^ a == a:
        f = 1
    #a^b^a^b^a^b^
    if la == lb and a ^ a == b and b ^ b == a:
        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 (a ^ b == c or a ^ c == b or b ^ a == c or b ^ c == a
                           or c ^ a == b or c ^ b == a):
        f = 1
    #x^y^(x^y)^x^y^
    if la == lb == lc + 1 and (a ^ b == c and a ^ b == a):
        f = 1
    #x^y^(x^y)^x^
    if lb == lc == la - 1 and (a ^ b == c and c ^ a == a):
        f = 1
if f:
    print('Yes')
else:
    print('No')
