#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**6) M,D = map(int,input().split()) length = 200 dp = [[False for i in range(1800+2)] for j in range(length)] dp[0][0] = 1 for i in range(1,10): dp[0][i] = 1 for n in range(1,length): dp[n] = dp[n-1]+[] for i in range(1,10): for d in range(1800+2)[::-1]: if d+i < 1800+2 and dp[n-1][d] is not False: dp[n][d+i] += dp[n-1][d] #ある桁数のその数字までの値を求める def hoge(digit,n): xs = [0 for i in range(1800+2)] upper = 0 for i in range(int(n)): for d in range(1800+2)[::-1]: if d+i < 1800+2: xs[d+i] += dp[digit-1][d] return xs def solve(num,digit): #numまでは足して,numになったらnum以降の数字で出来たものにnumを足したものを返す if digit == 0 or num == 0: a = [1 if i <= num else 0 for i in range(0,1800+2)] return a n = int(str(num)[0]) a = hoge(digit,n) b = solve(int(str(num)[1:]),digit-1) for i in range(1800+2): if i+n < 1800+2: a[i+n] += b[i] return a M_count = solve(M,len(str(M))-1) D_count = solve(D,len(str(D))-1) ans = 0 for i in range(1,1800+2): ans += M_count[i] * D_count[i] %(10**9+9) print(ans%(10**9+9))