import collections
import sys

n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)

if len(c) != 3:
    print('No')
    sys.exit()

value = list(c.values())
if value[0] != value[1] or value[1] != value[2] or value[2] != value[0]:
    print('No')
    sys.exit()

key = list(c.keys())
if key[0] ^ key[1] ^ key[2] != 0:
    print('No')
    sys.exit()

print('Yes')