Mets agree to deal with 2-time Yankees All-Star