Gentzen's Hauptsatz for the systems NI and NK