r (2) authorized a municipality, should the owner fail to make the alterations, to demolish the structure or to make the repairs itself and thereafter recover from the owner the expenses thereby incurred. (See, e.g., Health Dept. v. Rector of Trinity Church, 145 N. Y. 32; Adamec v. Post, 273 N. Y. 250, supra; Polsgrove v. Moss, 154 Ky. 408; Richards v. City of Columbia, 227 S. C. 538; City of Houston v. Lurie, 148 Tex. 391.)
If the legislation before us “ is addressed to a legitimate end and the measures taken are reasonable and appropriate to that end”, it may not be stricken as unconstitutional, even though it may interfere with rights established by existing contracts. (Home Bldg. & Loam Assn. v. Blaisdell, 290 U. S. 398, 438.) It is “ fundamental ”, we wrote in the Durham Realty Corp. case (230 N. Y., at p. 442), that “ the state may establish regulations reasonably necessary to secure the general welfare of the community by the exercise of its police power although the rights of private property are [thereby] * * * curtailed and freedom of contract is abridged.” (See, also, Guttag v. Shatzkin, 230 N. Y. 647.) Accordingly, when, as here, housing accommodations are in short supply and multiple dwellings become unfit for use and a source of danger, the State may enact legislation reasonably aimed at correcting the situation and promoting the public welfare, even though the means devised to accomplish that result may impair the obligation of the mortgagee’s contract with his mortgagor.