Reduction modulo p of differential equations