#include <bits/stdc++.h>

using namespace std;

long long C[111][111];

const long long MOD = 1e9 + 7;

void precalc() {
	for (int i = 0; i < 111; i++)
		C[i][0] = 1;
	for (int i = 1; i < 111; i++)
		for (int j = 1; j <= i; j++)
			C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD; //, cerr << C[i][j] << " \n"[i == j];
}

typedef unsigned long long ull;

vector<ull> lol;
ull cur = 0;

void rec(int len, int last) {
    lol.push_back(cur);
	if (len == 18) return;
	for (int i = last; i < 10; i++) {
		cur = cur * 10 + i;
		rec(len + 1, i);
		cur /= 10;
	}
	return;
}

int main() {
    ifstream in("numbers.in");
    ofstream out("numbers.out");
    
    string l, r;
    long long ans = 0;
    in >> l >> r;

    precalc();
    rec(0, 1);

    if (r.length() < 19) {
    	ull ll = stoll(l);
    	ull rr = stoll(r);
        for (auto x: lol) {
        	ans += ll <= x && x <= rr;
        }
        out << ans;
        return 0;
    }
    int n = r.length() - 1;
    out << (C[n + 9][n] + MOD - 1) % MOD;
    return 0;
}
