import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Created by chavit on 26.10.2015.
 */
public class numbers_vd {
    private static long MOD = (int) (1e+9 + 7);

    private long[][] c;

    private void run() throws FileNotFoundException {
        Scanner in = new Scanner(new File("numbers.in"));
        PrintWriter out = new PrintWriter("numbers.out");
        out.println(getAnswer(in.next(), in.next()));
        out.close();
    }

    public long getAnswer(String l, String r) {
        initC(r.length() + 10);
        long ans = countNumbers(stringToArray(r)) - countNumbers(stringToArray(l));
        if (fine(r)) {
            ans++;
        }
        ans = (ans % MOD + MOD) % MOD;
        return ans;
    }

    private long countNumbers(int[] number) {
        long ans = 0;
        int n = number.length;
        for (int i = 0; i < n; i++) {
            int prev = (i == 0) ? 0 : number[i - 1];
            if (number[i] < prev) {
                return ans;
            }
            for (int j = prev; j < number[i]; j++) {
                ans = (ans + numberOfPut(n - i - 1, 10 - j)) % MOD;
            }
        }
        return ans;
    }

    private long numberOfPut(int places, int digits) {
        return c[places + digits - 1][digits - 1];
    }

    private void initC(int max) {
        c = new long[max + 1][max + 1];
        c[0][0] = 1;
        for (int i = 0; i <= max; i++) {
            c[i][0] = 1;
            for (int j = 1; j <= i; j++) {
                c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % MOD;
            }
        }
    }

    private int[] stringToArray(String number) {
        int[] numberArray = new int[number.length()];
        for (int i = 0; i < number.length(); i++) {
            numberArray[i] = number.charAt(i) - '0';
        }
        return numberArray;
    }

    private boolean fine(String number) {
        for (int i = 1; i < number.length(); i++) {
            if (number.charAt(i) < number.charAt(i - 1)) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) throws FileNotFoundException {
        new numbers_vd().run();
    }
}
