from collections import Counter

def solve(a):
    counter = Counter(a)
    l = list(counter.values())
    if counter[0] > 0:
        if len(l) != 2:
            return False
        return min(l) == counter[0] and counter[0] * 2 == max(l)
    ks = list(counter.keys())
    if len(l) != 3:
        return False
    return l[0] == l[1] and l[2] == l[0] and ks[0] ^ ks[1] == ks[2]



if __name__ == '__main__':
    n = int(input())
    a = [int(s) for s in input().split()]
    print('Yes' if solve(a) else 'No')
