Mets signing former Yankees pitcher to 2-year deal