For a particle , E2 = (pc)2 + (moc2)2
and for a system of particle , (ΣE)2 = (Σpc)2 + (Σmoc2)2
so in that way before a collision,
(ΣEi)2 = (Σpic)2 + (Σmoic2)2
and after , (ΣEf)2 = (Σpfc)2 + (Σmofc2)2
and as far as i know energy and momentum is conserved . so that means ΣEi=ΣEf
and also Σpi=Σpf...