Can i take cephalexin if allergic to amoxicillin

Can i take cephalexin if allergic to amoxicillin