from collections import Counter 
import sys
def No():
    print("No")
    sys.exit()
N=int(input())
A = [int(i) for i in input().split()]
C=Counter(A)
if N%3:No()
if len(C)!=3:No()
bits = [format(a,"040b") for a in C.keys()]
if all([z.count("0")%2 for z in zip(*bits)]):
    print("Yes")
else:No()