activity which has been identified by the Secretary, in consultation with the Administrator of the Federal Emergency Management Agency, for mitigation of a natural hazard. (B) Exception The term qualified disaster mitigation expenditure shall not include any expenditure or portion thereof which is paid, funded, or reimbursed by a Federal, State, or local government entity, or any political subdivision, agency, or instrumentality thereof. (2) Qualified dwelling unit The term qualified dwelling unit means a dwelling unit which is— (A) located— (i) in the United States or in a territory of the United States, and (ii) in an area— (I) in which a Federal natural disaster declaration has been made within the preceding 5-year period, (II) which is adjacent to an area described in subclause (I), (III) which, during the taxable year or the period of the 5 taxable years preceding such taxable year, has received hazard mitigation assistance through the Federal Emergency Management Agency in regard to any natural disaster which, with respect to the expenditure described in paragraph (1) which is made by the taxpayer, is applicable to such expenditure, or (IV) which, with respect to any taxable year, has been designated as a community disaster resilience zone (as defined in section 206(a) of the Robert T. Stafford Disaster Relief and Emergency Assistance Act ( 42 U.S.C. 5136(a) )), and (B) used as a residence by the taxpayer. (d) Limitation (1) In general In the case of an expenditure described in clause (i) or (ii) of subsection (c)(1)(A), such expenditure shall be taken into account in determining the qualified disaster mitigation expenditures made by the taxpayer during the taxable year only if the onsite preparation, assembly, or original installation of the property with respect to which such expenditure is made has been completed in a manner that is deemed to be in compliance with the latest published editions of relevant consensus-based codes, specifications, and standards or any more restrictive Federal, State, or