#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long dp[100010][2][2] = {}; long long mod = 1000000007; int main() { string s; cin >> s; int n = s.size(); dp[0][1][1] = 1; for (int i = 1; i <= n; i++) { dp[i][1][0] += dp[i - 1][1][1]; dp[i][1][0] += dp[i - 1][1][0]; dp[i][0][0] += dp[i - 1][0][0] * 45; dp[i][0][0] += dp[i - 1][1][0] * 45; for (int j = 1; j < s[i - 1] - '0'; j++) { dp[i][0][0] += dp[i - 1][0][1] * j; } dp[i][0][1] += dp[i - 1][0][1] * (s[i - 1] - '0'); if (s[i - 1] != '0') { for (int j = 1; j < s[i - 1] - '0'; j++) { dp[i][0][0] += dp[i - 1][1][1] * j; } } dp[i][0][1] += dp[i - 1][1][1] * (s[i - 1] - '0'); dp[i][0][0] %= mod; dp[i][0][1] %= mod; dp[i][1][0] %= mod; dp[i][1][1] %= mod; } cout << (dp[n][0][0] + dp[n][0][1] + dp[n][1][0] + dp[n][1][1] + mod - 1) % mod << endl; }