def xor_circle(N: int, A: list)->bool:
    M = max(A)

    b = 1
    while b <= M:
        zero, one = 0, 0
        for a in A:
            if a & b:
                one += 1
            else:
                zero += 1

        if one != 2 * zero:
            return False
        b <<= 1

    return True


if __name__ == "__main__":
    N = int(input())
    A = [int(s) for s in input().split()]

    yes = xor_circle(N, A)
    print('Yes' if yes else 'No')
