Integrability of the Heisenberg Chains with Boundary Impurities and Their Bethe Ansatz