n = input() mod = 10**9+7 dp = [[0]*2 for i in range(len(n))] dp[0][0] = int(n[0]) dp[0][1] = (int(n[0])*(int(n[0])-1)//2+1) for i in range(1,len(n)): s = int(n[i]) dp[i][0] = dp[i-1][0]*s%mod dp[i][1] += (dp[i-1][1]*45+1)%mod dp[i][1] += s*(s-1)//2*dp[i-1][0]%mod dp[i][1] %= mod print((sum(dp[-1])-1)%mod)