import java.io.*; import java.util.*; public class Main { static final int MOD = 1000000009; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int[] month = getCounts(sc.next().toCharArray()); int[] day = getCounts(sc.next().toCharArray()); long ans = 0; for (int i = 1; i < month.length && i < day.length; i++) { ans += (long)month[i] * day[i] % MOD; ans %= MOD; } System.out.println(ans); } static int[] getCounts(char[] arr) { int length = arr.length; int[][] dp = new int[length][length * 10 + 10]; int count = 0; for (int i = 0; i < length; i++) { for (int j = i * 10 - i - 1; j >= 0 && i > 0; j--) { for (int k = 0; k < 10; k++) { dp[i][j + k] += dp[i - 1][j]; dp[i][j + k] %= MOD; } } for (int j = 0; j < arr[i] - '0'; j++) { dp[i][count + j]++; } count += arr[i] - '0'; } dp[length - 1][count]++; return dp[length - 1]; } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }