using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); static int[] LList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => int.Parse(ReadLine())).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = ReadLine(); var mod = 1_000_000_007; var dp1 = new long[n.Length]; dp1[0] = (n[0] - '1') * (n[0] - '0') / 2; var dp2 = 1L; for (var i = 1; i < n.Length; ++i) { dp1[i] = ((1 + dp1[i - 1]) * 45 + dp2 * ((n[i] - '1') * (n[i] - '0') / 2)) % mod; dp2 = dp2 * (n[i] - '0') % mod; } WriteLine((dp1[^1] + dp2) % mod); } }