Judgment unanimously modified on the law and as modified affirmed without costs, and matter remitted to Supreme Court for further proceedings, in accordance with the following memorandum: The court erred by setting aside the oral stipulation entered into by the parties in open court *943and simultaneously ratified by written stipulation. In our view, this stipulation was a valid “opting out” agreement (see, Domestic Relations Law § 236 [B] [3]; cf., Hanford v Hanford, 91 AD2d 829). Stipulations of settlement are favored by the courts and are not set aside absent good cause sufficient to invalidate a contract (see, Yuda v Yuda, 143 AD2d 657, 658; Sontag v Sontag, 114 AD2d 892, lv dismissed 66 NY2d 554) or a showing that the agreement is manifestly unfair to one spouse because of the other’s overreaching (Christian v Christian, 42 NY2d 63, 71-73). The mere fact that the terms of the agreement favor one party, without more, does not provide a sufficient basis for setting aside a stipulation (see, McFarland v McFarland, 70 NY2d 916, 918). In our view, the stipulation entered into by the parties here was not the product of the husband’s overreaching and is not manifestly unfair to the wife. Moreover, the wife was represented by independent counsel throughout the negotiation of the agreement.
We, therefore, reverse the judgment except to the extent that it grants a divorce to plaintiff, and remit the matter to Supreme Court for the entry of a judgment which incorporates the stipulation of January 19, 1988. (Appeal from judgment of Supreme Court, Erie County, Fudeman, J.—divorce.) Present—Doerr, J. P., Boomer, Pine, Balio and Lawton, JJ.