No trust created under a retirement plan, which is exempt from federal income taxation under the laws of the United States, is invalid as violating the rule against perpetuities or the rules governing the accumulation of income. Such a trust may continue for such time as may be necessary to accomplish the purposes for which it is created; may permit the accumulation of income until such time as the income is distributed to the beneficiaries under the terms of the trust; and may, according to its terms, be made irrevocable and the interest of its beneficiaries nontransferable by assignment or otherwise. A trust so made irrevocable is not subject to revocation upon the written consent of its beneficiaries as provided in 7-1.9.
N.Y. EPTL 9-1.7