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