UOJ Logo 黑暗爆炸OJ

DARKBZOJ

#4421. [Cerc2015] Digit Division

统计 下载数据

Description

给出一个数字串,现将其分成一个或多个子串,要求分出来的每个子串能Mod M等于0.
将方案数(mod 10^9+7)

Input

给出N,M,其中1<=N<=300 000,1<=M<=1000 000.
接下来一行,一个数字串,长度为N。

Output

如题 

Sample Input

4 2
1246

Sample Output

4

Hint

Source