Exact analytical solutions of a two-dimensional hydrogen atom in a constant magnetic field