from sys import exit
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
A = list(map(int, input().split()))

def noexit():
    print('No')
    exit()

def yesexit():
    print('Yes')
    exit()

setA = set(A)
if len(setA) > 3: noexit()

if N%3 != 0: noexit()

if 0 in setA:
    if len(setA) == 1: yesexit()
    elif len(setA) == 2: yesexit()
    else: noexit()

listA = list(setA)
if len(setA) != 3: noexit()
if listA[0]^listA[1]==listA[2] \
        and listA[1]^listA[2]==listA[0] \
        and listA[2]^listA[0]==listA[1]:
    new_list = [listA[0]]*(N//3) + [listA[1]]*(N//3) + [listA[2]]*(N//3)
    A.sort()
    new_list.sort()
    if A == new_list:
        yesexit()
    else:
        noexit()
else: noexit()