In this paper we give a full classification of global solutions of the obstacle problem for the fractional Laplacian (including the thin obstacle problem) with compact coincidence set and at most polynomial growth in dimension $N geq 3$. We do this in terms of a bijection onto a set of polynomials describing the asymptotics of the solution. Furthermore we prove that coincidence sets of global solutions that are compact are also convex if the solution has at most quadratic growth.