N = int(input())
a = [int(x) for x in input().split()]
ite = 0
for i in range(N):
    if a[i] != 0:
        break
    else:
        ite += 1
if ite == N - 1:
    print("Yes")
    exit()

if N % 3 != 0:
    print("No")
    exit()
else:
    n = N//3

a = sorted(a)
for j in range(n-1):
    if a[j] != a[j + 1]:
        print("No")
        exit()


for k in range(n, 2*n-1):
    if a[k] != a[k + 1]:
        print("No")
        exit()

for p in range(2*n, 3*n-1):
    if a[p] != a[p + 1]:
        print("No")
        exit()


if a[n] ^ a[0] != a[2*n]:
    print("No")
    exit()

print("Yes")
