# coding: utf-8
import collections
 
n = int(input())
a_list = list(map(int,input().split()))
 
c = collections.Counter(a_list)
 
#print(len(c.keys()))
ans_list = list(c.keys())
count_list = list(c.values())
count_list.sort()
 
#print(c.keys())
if len(c.keys()) == 1:
    if list(c.keys()) == [0]:
        print("Yes")
        quit()
 
if len(c.keys()) != 3:
    print("No")
    quit()
 
if ans_list[0] == ans_list[1] ^ ans_list[2]:
    if count_list[0]==count_list[1]==count_list[2]:
        print("Yes")
    else:
        print("No")
else:
    print("No")