Rev 17:9

9 Here is the mind that has wisdom. The seven heads are seven mountains, on which the woman sits. 

here is the mind which has wisdom – the fear of God is the beginning of this wisdom (Prov 9:10). Those who practice the lawless deeds of the beast, cannot understand who the beast is. Those who fear God, and keep His commandments, will understand who the beast, “the lawless one,” is.

the seven heads are seven mountains on which the woman sits – the woman who committed “fornication with the kings of the earth” gained her power by sitting on top of worldly power, the kingdoms of this world who were against the saints.