Except as provided in section two hundred thirty-six of the domestic relations law, a husband and wife cannot contract to alter or dissolve the marriage or to relieve either of his or her liability to support the other in such a manner that he or she will become incapable of self-support and therefore is likely to become a public charge. An agreement, heretofore or hereafter made between a husband and wife, shall not be considered a contract to alter or dissolve the marriage unless it contains an express provision requiring the dissolution of the marriage or provides for the procurement of grounds of divorce.
N.Y. Gen. Oblig. Law § 5-311