#!/usr/bin/env python3

n = int(eval(input()))

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

s = [0] * (n + 2)

rs = [0] * (n + 2)

for i in range(n):

    s[i + 1] = s[i] ^ a[i]

    rs[n - i] = rs[n - i + 1] ^ a[-i - 1]

ans = all(a[i] == rs[i + 2] ^ s[i] for i in range(n))

print((['No', 'Yes'][ans]))

#!/usr/bin/env python3

n = int(eval(input()))

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



dic = {}

for x in a:

    dic[x] = dic[x] + 1 if x in dic else 1



ans = all(k == 0 for k in list(dic.keys()))

if n % 3 == 0:

    if all(v == n // 3 for v in list(dic.values())):

        x, y, z = list(dic.keys())

        ans |= (x ^ y == z)

    else:

        ans |= all(v == n * 2 // 3 or (v == n // 3 and k == 0) for k, v in list(dic.items()))

print((['No', 'Yes'][ans]))

#!/usr/bin/env python3
n = int(eval(input()))
a = list(map(int, input().split()))
s = [0] * (n + 2)
rs = [0] * (n + 2)
for i in range(n):
    s[i + 1] = s[i] ^ a[i]
    rs[n - i] = rs[n - i + 1] ^ a[-i - 1]
ans = all(a[i] == rs[i + 2] ^ s[i] for i in range(n))
print((["No", "Yes"][ans]))

#!/usr/bin/env python3
n = int(eval(input()))
a = list(map(int, input().split()))
dic = {}
for x in a:
    dic[x] = dic[x] + 1 if x in dic else 1
ans = all(k == 0 for k in list(dic.keys()))
if n % 3 == 0:
    if all(v == n // 3 for v in list(dic.values())):
        x, y, z = list(dic.keys())
        ans |= x ^ y == z
    else:
        ans |= all(
            v == n * 2 // 3 or (v == n // 3 and k == 0) for k, v in list(dic.items())
        )
print((["No", "Yes"][ans]))

-s = [0] * (n + 2) -rs = [0] * (n + 2) -for i in range(n): -    s[i + 1] = s[i] ^ a[i] -    rs[n - i] = rs[n - i + 1] ^ a[-i - 1] -ans = all(a[i] == rs[i + 2] ^ s[i] for i in range(n)) +dic = {} +for x in a: +    dic[x] = dic[x] + 1 if x in dic else 1 +ans = all(k == 0 for k in list(dic.keys())) +if n % 3 == 0: +    if all(v == n // 3 for v in list(dic.values())): +        x, y, z = list(dic.keys()) +        ans |= x ^ y == z +    else: +        ans |= all( +            v == n * 2 // 3 or (v == n // 3 and k == 0) for k, v in list(dic.items()) +        )