from collections import Counter


def solve(n, aaa):
    if n % 3 != 0:
        return False

    cnt = list(Counter(aaa).items())
    if len(cnt) != 3:
        return False
    if any(c[1] != n // 3 for c in cnt):
        return False
    a1, a2, a3 = (c[0] for c in cnt)
    if a1 ^ a2 == a3:
        return True
    return False


n = int(input())
aaa = list(map(int, input().split()))
print('Yes' if solve(n, aaa) else 'No')
