#include #include using namespace std; using namespace atcoder; using mint = modint1000000007; mint dp[100010][2]; int main(){ string s; cin >> s; int n = s.size(); dp[0][1] = 1; for (int i = 1; i <= n; i++) { dp[i][0] = 1; } for (int i = 0; i < n; i++) { for (int tight = 0; tight < 2; tight++) { int lim = tight ? s[i] - '0' : 9; for (int j = 0; j <= lim; j++) { dp[i + 1][tight & (j == lim)] += dp[i][tight] * mint(j); } } } mint ans = dp[n][0] + dp[n][1]; cout << ans.val()-1 << endl; return 0; }