#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LONG_INF 10000000000000000 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) long long plus_map[2][10000] = {}; long long dper[2][300][2][5000] = {}; int main() { string a, b; cin >> a >> b; for (int i = 0;i < 2;++i) { string m; if (i == 0) { m = a; } else m = b; dper[i][0][1][0] = 1; for (int q = 0;q < m.length();++q) { for (int j = 0;j < 4000;++j) { //どの数でも選べる for (int t = 0;t < 10;++t) { dper[i][q+1][0][t + j] += dper[i][q][0][j]; dper[i][q+1][0][t + j] %= MAX_MOD; } //どの数でも選べない for (int t = 0;t < m[q] - '0';++t) { dper[i][q+1][0][t + j] += dper[i][q][1][j]; dper[i][q+1][0][t + j] %= MAX_MOD; } dper[i][q+1][1][j + (m[q] - '0')] += dper[i][q][1][j]; dper[i][q+1][1][j + (m[q] - '0')] %= MAX_MOD; } } for (int q = 1;q < 5000;++q) { plus_map[i][q] = dper[i][m.length()][0][q] + dper[i][m.length()][1][q]; } } long long ans = 0; for (int i = 1;i < 5000;++i) { ans += plus_map[0][i] * plus_map[1][i]; ans %= MAX_MOD; } cout << ans << endl; return 0; }