#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

ll dp[300000][2] = {0};
ll sum[300000][2] = {0};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s, t;
    cin >> s >> t;
    ll n = s.size();
    dp[0][0] = 1;
    for (ll i = 0; i < n; i++)
    {
        ll sNum = s[i] - '0';
        ll tNum = t[i] - '0';
        if (t[i] != '?')
        {
            if (sNum == tNum)
            {
                (dp[i + 1][0] += dp[i][0]) %= MOD;
                (dp[i + 1][1] += dp[i][1]) %= MOD;
                (sum[i + 1][1] += (sum[i][1] * 10 % MOD + dp[i][1] * tNum % MOD) % MOD) %= MOD;
                (sum[i + 1][0] += (sum[i][0] * 10 % MOD + dp[i][0] * tNum % MOD) % MOD) %= MOD;
            }
            else if (sNum < tNum)
            {
                (dp[i + 1][1] += dp[i][1]) %= MOD;
                (sum[i + 1][1] += (sum[i][1] * 10 % MOD + dp[i][1] * tNum % MOD) % MOD) %= MOD;
            }
            else
            {
                (dp[i + 1][1] += dp[i][1]) %= MOD;
                (dp[i + 1][1] += dp[i][0]) %= MOD;
                (sum[i + 1][1] += (sum[i][1] * 10 % MOD + dp[i][1] * tNum % MOD) % MOD) %= MOD;
                (sum[i + 1][1] += (sum[i][0] * 10 % MOD + dp[i][0] * tNum % MOD) % MOD) %= MOD;
            }
        }
        else
        {
            for (ll j = 0; j <= 9; j++)
            {
                tNum = j;
                if (sNum == tNum)
                {
                    (dp[i + 1][0] += dp[i][0]) %= MOD;
                    (dp[i + 1][1] += dp[i][1]) %= MOD;
                    (sum[i + 1][1] += (sum[i][1] * 10 % MOD + dp[i][1] * tNum % MOD) % MOD) %= MOD;
                    (sum[i + 1][0] += (sum[i][0] * 10 % MOD + dp[i][0] * tNum % MOD) % MOD) %= MOD;
                }
                else if (sNum < tNum)
                {
                    (dp[i + 1][1] += dp[i][1]) %= MOD;
                    (sum[i + 1][1] += (sum[i][1] * 10 % MOD + dp[i][1] * tNum % MOD) % MOD) %= MOD;
                }
                else
                {
                    (dp[i + 1][1] += dp[i][1]) %= MOD;
                    (dp[i + 1][1] += dp[i][0]) %= MOD;
                    (sum[i + 1][1] += (sum[i][1] * 10 % MOD + dp[i][1] * tNum % MOD) % MOD) %= MOD;
                    (sum[i + 1][1] += (sum[i][0] * 10 % MOD + dp[i][0] * tNum % MOD) % MOD) %= MOD;
                }
            }
        }
    }
    cout << (sum[n][0] + sum[n][1]) % MOD << endl;
}
