  We develop means of computing exact degerenacies of BPS black holes on toric
Calabi-Yau manifolds. We show that the gauge theory on the D4 branes wrapping
ample divisors reduces to 2D q-deformed Yang-Mills theory on necklaces of
P^1's. As explicit examples we consider local P^2, P^1 x P^1 and A_k type ALE
space times C. At large N the D-brane partition function factorizes as a sum
over squares of chiral blocks, the leading one of which is the topological
closed string amplitude on the Calabi-Yau. This is in complete agreement with
the recent conjecture of Ooguri, Strominger and Vafa.
