a = int(eval(input()))

b = list(map(int, input().split()))

c = {}



for i in range(a):

    if b[i] not in c:

        c.setdefault(b[i], 1)

    else:

        c[b[i]] += 1



if len(c) == 3:

    f = list(c.values())

    for i in range(1, len(f)):

        if f[i] != f[i-1]:

            print("No")

            exit()

    g = list(c.keys())

    if g[0] ^ g[1] == g[2]:

        print("Yes")

    else:

        print("No")

elif len(c) == 2:

    f = list(c.values())

    if f[0] != f[1]*2 and f[0]*2 != f[1]:

        print("No")

        exit()

    g = list(c.keys())

    if g[0] == 0 or g[1] == 0:

        print("Yes")

    else:

        print("No")

elif len(c) == 1:

    g = list(c.keys())

    if g[0] == 0:

        print("Yes")

    else:

        print("No")

else:

    print("No")

    exit()

a = int(eval(input()))

b = list(map(int, input().split()))

e = {}

for i in b:

    if i not in e:

        e[i] = 1

    else:

        e[i] += 1

if len(e) > 3:

    print("No")

elif len(e) == 3:

    x, y, z = list(map(int, list(e.keys())))

    xx, yy, zz = list(map(int, list(e.values())))

    if x ^ y == z and y ^ z == x and z ^ x == y and xx == yy == zz:

        print("Yes")

    else:

        print("No")

elif len(e) == 2:

    x, y = list(map(int, list(e.keys())))

    xx, yy = list(map(int, list(e.values())))

    if (x == 0 and 2 * xx == yy) or (y == 0 and xx == 2 * yy):

        print("Yes")

    else:

        print("No")

elif len(e) == 1:

    x = list(map(int, list(e.keys())))[0]

    if x == 0:

        print("Yes")

    else:

        print("No")

a = int(eval(input()))
b = list(map(int, input().split()))
c = {}
for i in range(a):
    if b[i] not in c:
        c.setdefault(b[i], 1)
    else:
        c[b[i]] += 1
if len(c) == 3:
    f = list(c.values())
    for i in range(1, len(f)):
        if f[i] != f[i - 1]:
            print("No")
            exit()
    g = list(c.keys())
    if g[0] ^ g[1] == g[2]:
        print("Yes")
    else:
        print("No")
elif len(c) == 2:
    f = list(c.values())
    if f[0] != f[1] * 2 and f[0] * 2 != f[1]:
        print("No")
        exit()
    g = list(c.keys())
    if g[0] == 0 or g[1] == 0:
        print("Yes")
    else:
        print("No")
elif len(c) == 1:
    g = list(c.keys())
    if g[0] == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")
    exit()

a = int(eval(input()))
b = list(map(int, input().split()))
e = {}
for i in b:
    if i not in e:
        e[i] = 1
    else:
        e[i] += 1
if len(e) > 3:
    print("No")
elif len(e) == 3:
    x, y, z = list(map(int, list(e.keys())))
    xx, yy, zz = list(map(int, list(e.values())))
    if x ^ y == z and y ^ z == x and z ^ x == y and xx == yy == zz:
        print("Yes")
    else:
        print("No")
elif len(e) == 2:
    x, y = list(map(int, list(e.keys())))
    xx, yy = list(map(int, list(e.values())))
    if (x == 0 and 2 * xx == yy) or (y == 0 and xx == 2 * yy):
        print("Yes")
    else:
        print("No")
elif len(e) == 1:
    x = list(map(int, list(e.keys())))[0]
    if x == 0:
        print("Yes")
    else:
        print("No")

-c = {} -for i in range(a): -    if b[i] not in c: -        c.setdefault(b[i], 1) +e = {} +for i in b: +    if i not in e: +        e[i] = 1 -        c[b[i]] += 1 -if len(c) == 3: -    f = list(c.values()) -    for i in range(1, len(f)): -        if f[i] != f[i - 1]: -            print("No") -            exit() -    g = list(c.keys()) -    if g[0] ^ g[1] == g[2]: +        e[i] += 1 +if len(e) > 3: +    print("No") +elif len(e) == 3: +    x, y, z = list(map(int, list(e.keys()))) +    xx, yy, zz = list(map(int, list(e.values()))) +    if x ^ y == z and y ^ z == x and z ^ x == y and xx == yy == zz: -elif len(c) == 2: -    f = list(c.values()) -    if f[0] != f[1] * 2 and f[0] * 2 != f[1]: -        print("No") -        exit() -    g = list(c.keys()) -    if g[0] == 0 or g[1] == 0: +elif len(e) == 2: +    x, y = list(map(int, list(e.keys()))) +    xx, yy = list(map(int, list(e.values()))) +    if (x == 0 and 2 * xx == yy) or (y == 0 and xx == 2 * yy): -elif len(c) == 1: -    g = list(c.keys()) -    if g[0] == 0: +elif len(e) == 1: +    x = list(map(int, list(e.keys())))[0] +    if x == 0: -else: -    print("No") -    exit()