A converse to a theorem of Gross--Zagier, Kolyvagin and Rubin