A policy, endorsement or contract providing coverage for the peril of flood must require the insurer to give 45-days' prior written notice of cancellation or nonrenewal to the insured and any regulated lending institution or federal agency that is a mortgagee. An insurer or insured may cancel during the term of the policy or upon renewal if the cancellation is for a valid reason under the National Flood Insurance Program.