No grantee of real property shall be liable upon any indebtedness secured by a mortgage thereon executed prior to the time of the conveyance of the real property to the grantee, nor shall he be liable for any deficiency that may remain upon the foreclosure and sale of real property covered by such a mortgage, after application of the proceeds of sale, unless such grantee shall simultaneously with the conveyance to him of such real property execute and acknowledge, before an officer authorized to take acknowledgments of deeds, a statement in writing stating in substance that such grantee assumes and agrees to pay such mortgage debt and giving the specific amount of the debt assumed. The execution and acknowledgment by a grantee of the deed of conveyance to him containing such written statement shall be sufficient compliance with the provisions of this section. This section shall not apply, however, where, subsequent to the conveyance and upon an extension or modification of the indebtedness secured by the mortgage, the grantee shall execute and acknowledge, before an officer authorized to take acknowledgments of deeds, a statement in writing stating that such grantee assumes and agrees to pay such mortgage debt, and giving the specific amount of the debt assumed.
N.Y. Gen. Oblig. Law § 5-705