# coding: utf-8
import collections

n = int(input())
a_list = list(map(int,input().split()))

c = collections.Counter(a_list)

#print(len(c.keys()))

if len(c.keys()) != 3:
    print("No")
    quit()
    
ans_list = list(c.keys())
count_list = list(c.values())

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")