Hyperon production in lead-lead interactions at 40 and 160 A GeV/c