import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines write=sys.stdout.write M,D=map(int,readline().split()) mod=10**9+9 M+=1 M=list(map(int,list(str(M)))) dpM=[0]*1801 for i in range(1,M[0]): dpM[i]+=1 sum_M=M[0] for m in M[1:]: prevM=dpM dpM=[0]*1801 for s in range(1801): for i in range(10): if s+i<1801: dpM[s+i]+=prevM[s] dpM[s+i]%=mod for i in range(m): dpM[sum_M+i]+=1 for i in range(1,10): dpM[i]+=1 sum_M+=m D+=1 D=list(map(int,list(str(D)))) dpD=[0]*1801 for i in range(1,D[0]): dpD[i]+=1 sum_D=D[0] for d in D[1:]: prevD=dpD dpD=[0]*1801 for s in range(1801): for i in range(10): if s+i<1801: dpD[s+i]+=prevD[s] dpD[s+i]%=mod for i in range(d): dpD[sum_D+i]+=1 for i in range(1,10): dpD[i]+=1 sum_D+=d ans=sum(m*d%mod for m,d in zip(dpM,dpD))%mod print(ans)