Automatic Differentiation of Programs with Discrete Randomness