from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

def err():
    print('No')
    quit()

n = inp()
a = inpl()
if n%3: err()
c = Counter(a)
if len(c.keys()) != 3:
    err()
for x in c.values():
    if x != n//3:
        err()
x,y,z = c.keys()
if x^y != z:
    err()
print('Yes')
