(b) Notwithstanding the provisions of paragraph (a) of this subdivision, any person, corporation, society, institution or other organization who or which violates subdivision six of section three hundred seventy-four of this title, where such unlawful compensation or thing of value accepted or received exceeds five thousand dollars in value, shall be guilty of a class E felony as defined in the penal law. Any person, corporation, society, institution, or other organization who or which violates subdivision six of section three hundred seventy-four of this title, where such unlawful compensation or thing of value accepted or received exceeds five thousand dollars in value, after having been previously convicted of violating subdivision six of section three hundred seventy-four of this title, shall be guilty of a class D felony as defined in the penal law.