Sheaves and Functions Modulo p