# -*- coding: utf-8 -*-
"""
Created on Sun Jul 14 20:27:59 2019

@author: ctiuser
"""
import sys

N = int(input())
A = list(map(int,input().split()))

A.sort()

if N % 3 != 0:
    print('No')
    sys.exit()

flg = True
if A[0] != A[N//3-1]:
    flg = False
if A[N//3] != A[(2*N)//3-1]:
    flg = False
if A[(2*N)//3] != A[(3*N)//3-1]:
    flg = False

if A[0] ^ A[N//3] != A[(2*N)//3]:
    flg = False

if flg:
    print('Yes')
else:
    print('No')