import sys

input = sys.stdin.readline

from collections import Counter



N = int(eval(input()))



c = Counter((int(x) for x in input().split()))



# 0がある場合

# 0,x,x,0,x,x

# あるいは

# 0,0,0,0 (any length is ok)



if c[0] > 0:

    if len(c) == 1:

        bl = True

    else:

        if len(c) > 2:

            bl = False

        else:

            bl = (N == 3 * c[0])

else:

    # 0がない場合

    # x,y,z,x,y,z で3つとも異なる

    se = set(c.keys())

    if len(se) != 3:

        bl = False

    else:

        bl = True

        xor = 0

        for key in se:

            xor ^= key

            if c[key] * 3 != N:

                bl = False

        if xor != 0:

            bl = False



answer = 'Yes' if bl else 'No'

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



"""

・a,b,a+b,a,b,a+b,...

・0,a,a,0,a,a,...

・0,0,0,0,0,0,...

"""



N,*A = list(map(int,read().split()))



def solve(N,A):

    if all(x == 0 for x in A):

        return True

    q,r = divmod(N,3)

    if r:

        return False

    from collections import Counter

    counter = Counter(A)

    n = len(counter)

    if n == 1:

        return False

    if n == 2:

        a,b = list(counter.keys())

        if a > b:

            a,b = b,a

        if a != 0:

            return False

        # 0,b

        if counter[0] != N//3:

            return False

        return True

    if n == 3:

        a,b,c = list(counter.keys())

        for x in [a,b,c]:

            if counter[x] != q:

                return False

        return a^b^c == 0



answer = 'Yes' if solve(N,A) else 'No'

print(answer)
import sys

input = sys.stdin.readline
from collections import Counter

N = int(eval(input()))
c = Counter((int(x) for x in input().split()))
# 0がある場合
# 0,x,x,0,x,x
# あるいは
# 0,0,0,0 (any length is ok)
if c[0] > 0:
    if len(c) == 1:
        bl = True
    else:
        if len(c) > 2:
            bl = False
        else:
            bl = N == 3 * c[0]
else:
    # 0がない場合
    # x,y,z,x,y,z で3つとも異なる
    se = set(c.keys())
    if len(se) != 3:
        bl = False
    else:
        bl = True
        xor = 0
        for key in se:
            xor ^= key
            if c[key] * 3 != N:
                bl = False
        if xor != 0:
            bl = False
answer = "Yes" if bl else "No"
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
"""
・a,b,a+b,a,b,a+b,...
・0,a,a,0,a,a,...
・0,0,0,0,0,0,...
"""
N, *A = list(map(int, read().split()))


def solve(N, A):
    if all(x == 0 for x in A):
        return True
    q, r = divmod(N, 3)
    if r:
        return False
    from collections import Counter

    counter = Counter(A)
    n = len(counter)
    if n == 1:
        return False
    if n == 2:
        a, b = list(counter.keys())
        if a > b:
            a, b = b, a
        if a != 0:
            return False
        # 0,b
        if counter[0] != N // 3:
            return False
        return True
    if n == 3:
        a, b, c = list(counter.keys())
        for x in [a, b, c]:
            if counter[x] != q:
                return False
        return a ^ b ^ c == 0


answer = "Yes" if solve(N, A) else "No"
print(answer)

-input = sys.stdin.readline -from collections import Counter +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +""" +・a,b,a+b,a,b,a+b,... +・0,a,a,0,a,a,... +・0,0,0,0,0,0,... +""" +N, *A = list(map(int, read().split())) -N = int(eval(input())) -c = Counter((int(x) for x in input().split())) -# 0がある場合 -# 0,x,x,0,x,x -# あるいは -# 0,0,0,0 (any length is ok) -if c[0] > 0: -    if len(c) == 1: -        bl = True -    else: -        if len(c) > 2: -            bl = False -        else: -            bl = N == 3 * c[0] -else: -    # 0がない場合 -    # x,y,z,x,y,z で3つとも異なる -    se = set(c.keys()) -    if len(se) != 3: -        bl = False -    else: -        bl = True -        xor = 0 -        for key in se: -            xor ^= key -            if c[key] * 3 != N: -                bl = False -        if xor != 0: -            bl = False -answer = "Yes" if bl else "No" + +def solve(N, A): +    if all(x == 0 for x in A): +        return True +    q, r = divmod(N, 3) +    if r: +        return False +    from collections import Counter + +    counter = Counter(A) +    n = len(counter) +    if n == 1: +        return False +    if n == 2: +        a, b = list(counter.keys()) +        if a > b: +            a, b = b, a +        if a != 0: +            return False +        # 0,b +        if counter[0] != N // 3: +            return False +        return True +    if n == 3: +        a, b, c = list(counter.keys()) +        for x in [a, b, c]: +            if counter[x] != q: +                return False +        return a ^ b ^ c == 0 + + +answer = "Yes" if solve(N, A) else "No"