#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

const ll mod = 1e9+7;

ll dp[200010][2][2];

int main(){
  string s, t;
  cin >> s >> t;

  int n = sz(s);
  dp[0][0][1] = 1;
  rep(i,n) {
    const int sD = s[i] - '0'; 
    if (t[i] == '?') {
      rep(j,2) {
        for (int d = 0; d <= (j ? 9 : sD); d++) {
          (dp[i+1][j||(d<sD)][0] += dp[i][j][0] * 10 + d * dp[i][j][1]) %= mod;
          (dp[i+1][j||(d<sD)][1] += dp[i][j][1]) %= mod;
        }
      }
    } else {
      const int tD = t[i] - '0';
      rep(j,2) {
        if (sD < tD && j == 0) continue;
        (dp[i+1][j||(tD<sD)][0] += dp[i][j][0] * 10 + tD * dp[i][j][1]) %= mod;
        (dp[i+1][j||(tD<sD)][1] += dp[i][j][1]) %= mod;
      }
    }
  }
  cout << (dp[n][0][0] + dp[n][1][0]) % mod << endl;
  return 0;
} 
