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

res = 'Yes'

a_dict = dict()

for a in a_list:
    if a not in a_dict.keys():
        a_dict[a] = 1
    else:
        a_dict[a] += 1

a_keys = list(a_dict.keys())
if len(a_keys) != 3:
    res = 'No'
else:
    a, b, c = a_keys
    if a_dict[a] != a_dict[b]:
        res = 'No'
    if a_dict[a] != a_dict[c]:
        res = 'No'
    if a^b != c:
        res = 'No'
    if b^c != a:
        res = 'No'
    if c^a != b:
        res = 'No'

print(res)
