char s['~~'];long d[2]['~~'];m=1e9+7,z,i,j,M;main(f){for(scanf("%s%d",s,&M);j