# Electron configuration of Y(2+) ion

Why is the electron configuration of $\ce{Y^2+}$ $\mathrm{[Kr]5s^1}$ rather than $\mathrm{[Kr]4d^1}$? It seems as though there are numerous anomalies from the typical electron configuration rules, but can one predict these exceptions (and if so, how)?

What causes one electron to be removed from the $\mathrm{5s}$ orbital and one from the $\mathrm{4d}$ orbital, is it simply due to the $\mathrm{5s}$ energy decreasing below the $\mathrm{4d}$ energy after the first ionization?