Susceptible-infected-susceptible epidemics on the complete graph and the star graph: Exact analysis