#include<bits/stdc++.h>
using namespace std;
#define int long long

template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};
const int MOD = 1e9 + 7;

typedef modint<MOD> mint;
int mod_pow(int n,int p,int MOD){ // a/n ≡ a*n^(p-2) nとpは互いに素
  int r = 1;
  for(; p > 0; p >>= 1){
    if(p & 1LL) r = (r * n) % MOD;
    n = (n * n) % MOD;
  }
  return r; // r = n^p % MOD
}

  mint dpl[200001][10][2]={};
  mint dpr[200001][10][2]={};
signed main(){

  string s,t; cin >> s >> t;

  int n = s.size();
  dpl[0][0][0] = 1;
  for(int i = 1; i <= n; i++){
    if(t[i-1] == '?'){
      int d = (int)(s[i-1]-'0');
      for(int j = 0; j < 10; j++){
        for(int k = 0; k < 10; k++){
          if(j < d) {
              dpl[i][j][1] += dpl[i-1][k][1] + dpl[i-1][k][0];
              
          }
          if(j == d){
            dpl[i][j][0] += dpl[i-1][k][0];
            dpl[i][j][1] += dpl[i-1][k][1];
          }
          if(j > d) dpl[i][j][1] += dpl[i-1][k][1];
        }
      }
    }
    else {
      int d = s[i-1]-'0';
      int dd = t[i-1]-'0';
      for(int j = dd; j < dd+1; j++){
        for(int k = 0; k < 10; k++){
          if(j < d) dpl[i][j][1] += dpl[i-1][k][1] + dpl[i-1][k][0];
          if(j == d){
            dpl[i][j][0] += dpl[i-1][k][0];
            dpl[i][j][1] += dpl[i-1][k][1];
          }
          if(j > d) dpl[i][j][1] += dpl[i-1][k][1];
        }
      }
    }
  }
  //cout << dpl[1][6][1] << " " << dpl[2][9][1] << endl;
  for(int i = n; i > 0; i--){
      if(i==n){
          int d = s[i-1]-'0';
          if(t[i-1]=='?'){
              for(int j=0;j<10;j++){
                  if(j<=d){
                      dpr[i][j][1] = 1;
                  }else if(j>d){
                      dpr[i][j][0] = 1;
                  }
              }
          }else{
              
              for(int j=(t[i-1]-'0');j<(t[i-1]-'0')+1;j++){
                  if(j<=d){
                      dpr[i][j][1] = 1;
                  }else if(j>d){
                      dpr[i][j][1] = 0;
                  }
              }
          }

          continue;
      }
    if(t[i-1] == '?'){
      int d = (int)(s[i-1]-'0');
      for(int j = 0; j < 10; j++){
        for(int k = 0; k < 10; k++){
          if(j < d) dpr[i][j][1] += dpr[i+1][k][1] + dpr[i+1][k][0];
          if(j == d){
            dpr[i][j][0] += dpr[i+1][k][0];
            dpr[i][j][1] += dpr[i+1][k][1];
          }
          if(j > d) dpr[i][j][0] += dpr[i+1][k][1] + dpr[i+1][k][0];
        }
      }
    }
    else {
      int dd = t[i-1]-'0';
      
      int d = s[i-1]-'0';
      for(int j = dd; j < dd+1; j++){
        for(int k = 0; k < 10; k++){
          if(j < d) dpr[i][j][1] += dpr[i+1][k][1] + dpr[i+1][k][0];
          if(j == d){
            dpr[i][j][0] += dpr[i+1][k][0];
            dpr[i][j][1] += dpr[i+1][k][1];
          }
          if(j > d) dpr[i][j][0] += dpr[i+1][k][1] + dpr[i+1][k][0];
        }
      }
    }
  }


  mint ans = 0;
  for(int i = 0; i <= n; i++){
    for(int j = 0; j < 10; j++){
      ans += (dpl[i][j][1] * (dpr[i][j][0]+dpr[i][j][1]) )* (j * mod_pow(10,n-i,MOD)%MOD);
      ans += (dpl[i][j][0] * (dpr[i][j][1]) ) * (j * mod_pow(10,n-i,MOD)%MOD);
    }
  }
  cout << ans.value() << endl;

  return 0;
}



Measured memory_bytes: 66096