#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 200005

enum Type{

	SAME,
	SMALL,
};


int length;
ll sum_table[2][SIZE],count_table[2][SIZE];
char S[SIZE],T[SIZE];
Type type_array[2] = {SAME,SMALL};


int main(){

	scanf("%s",S);
	scanf("%s",T);

	for(length = 0; S[length] != '\0'; length++);

	for(int i = 0; i < length; i++){
		for(int k = 0; k < 2; k++){

			sum_table[k][i] = 0;
			count_table[k][i] = 0;
		}
	}

	count_table[SAME][0] = 1;

	Type type;

	for(int i = 0; i <= length-1; i++){
		for(int k = 0; k < 2; k++){

			type = type_array[k];
			if(count_table[type][i] == 0)continue;

			for(ll num = 0; num <= 9; num++){
				if(T[i] != '?' && (T[i]-'0') != num)continue;

				if(type == SAME){

					if(num > S[i]-'0')continue;

					if(num == S[i]-'0'){

						count_table[SAME][i+1] = 1;
						sum_table[SAME][i+1] = (sum_table[SAME][i]*10+num)%MOD;

					}else{ //num < S[i]-'0'

						count_table[SMALL][i+1] += 1;
						sum_table[SMALL][i+1] += (sum_table[SAME][i]*10+num)%MOD;
						sum_table[SMALL][i+1] %= MOD;
					}

				}else{ //type == SMALL

					count_table[SMALL][i+1] += count_table[SMALL][i];
					count_table[SMALL][i+1] %= MOD;
					sum_table[SMALL][i+1] += (sum_table[SMALL][i]*10+num*count_table[SMALL][i])%MOD;
					sum_table[SMALL][i+1] %= MOD;
				}
			}
		}
	}

	printf("%lld\n",(sum_table[SAME][length]+sum_table[SMALL][length])%MOD);

	return 0;
}

