import java.util.*; public class Main { static final int MOD = 1000000009; public static void main (String[] args) { Scanner sc = new Scanner(System.in); int[] mdp = getDP(sc.next().toCharArray()); int[] ddp = getDP(sc.next().toCharArray()); long ans = 0; for (int i = 1; i < 1800; i++) { ans += (long)mdp[i] * ddp[i] % MOD; ans %= MOD; } System.out.println(ans); } static int[] getDP(char[] arr) { int[] dp = new int[1800]; int sum = 0; for (int i = 0; i < arr.length; i++) { for (int j = dp.length - 10; j >= 0; j--) { for (int k = 1; k < 10; k++) { dp[j + k] += dp[j]; dp[j + k] %= MOD; } } for (int j = 0; j < arr[i] - '0'; j++) { dp[sum + j]++; } sum += arr[i] - '0'; } dp[sum]++; return dp; } }