import java.util.*; public class Main { public static long MOD = (long)Math.pow(10, 9) + 9; public static long[][][] dp; public static void main(String[] args) { Scanner sc = new Scanner(System.in); String M = sc.next(); String D = sc.next(); int lenM = M.length(); int lenD = D.length(); func(D); int len2 = D.length(); long[][][] dp2 = new long[len2][1801][2]; for(int i = 0; i < len2; i++) { for(int j = 0; j < 1801; j++) { for(int k = 0; k < 2; k++) { dp2[i][j][k] = dp[i][j][k]; } } } func(M); long ans = 0; for(int i = 1; i < 1801; i++) { long t1 = (dp[lenM - 1][i][0] + dp[lenM - 1][i][1]) % MOD; long t2 = (dp2[lenD - 1][i][0] + dp2[lenD - 1][i][1]) % MOD; long t = (t1 * t2) % MOD; ans = (ans + t) % MOD; } System.out.println(ans); } public static void func(String s) { int len = s.length(); dp = new long[len][1801][2]; int first = Integer.parseInt(String.valueOf(s.charAt(0))); for(int i = 0; i < first; i++) { dp[0][i][1] = 1; } dp[0][first][0] = 1; for(int i = 1; i < len; i++) { int d = Integer.parseInt(String.valueOf(s.charAt(i))); for(int j = 0; j <= (9 * i); j++) { dp[i][j + d][0] = (dp[i][j + d][0] + dp[i - 1][j][0]) % MOD; for(int k = 0; k < d; k++) { dp[i][j + k][1] = (dp[i][j + k][1] + dp[i - 1][j][0]) % MOD; } for(int k = 0; k < 10; k++) { dp[i][j + k][1] = (dp[i][j + k][1] + dp[i - 1][j][1]) % MOD; } } } } }