#include <bits/stdc++.h>
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,popcnt,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const int MAXN = 2007;
const long long inf = 2e9 + 239;
const long double EPS = 1e-4;
const long double PI = acos(-1);
int mod = (int)998244353;
const int MOD7 = 1000000007;
const int MOD9 = 1000000009;
const int a228 = 18;
const long long kekmod = 1791791791;
const long long bestmod = 1148822869;
vector<long long> mods = {kekmod, bestmod, mod, MOD9, 1000000007};
vector<long long> hashpows = {29, 31, 37, 43, 47, 53, 179, 229};
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count() +
            228 + 'i' + 'q' + 1337 + 1488);
long long MOD = mods[rnd() % mods.size()];
long long hashpow = hashpows[rand() % hashpows.size()];
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  long long c1 = 1;
  long long c2 = 1;
  long long c3 = 1;
  long long c4 = 1;
  for (int i = 0; i < s1.size(); ++i) {
    c1 *= (s1[i] == '?' ? 10 : 1);
    c1 *= (s2[i] == '?' ? 10 : 1);
    c1 %= MOD7;
    if (s1[i] != '?' && s2[i] != '?' && s1[i] < s2[i]) c2 = 0;
    if (s1[i] != '?' && s2[i] != '?' && s1[i] > s2[i]) c3 = 0;
    if (s1[i] != '?' && s2[i] != '?' && s1[i] != s2[i]) c4 = 0;
    if (s1[i] == '?' && s2[i] == '?') {
      c4 *= 10;
      c4 %= MOD7;
      c2 *= 55;
      c2 %= MOD7;
      c3 *= 55;
      c3 %= MOD7;
    }
    if (s1[i] == '?' && s2[i] != '?') {
      c2 *= '9' - s2[i] + 1;
      c2 %= MOD7;
      c3 *= s2[i] - '0' + 1;
      c3 %= MOD7;
    } else if (s1[i] != '?' && s2[i] == '?') {
      c2 *= s1[i] - '0' + 1;
      c3 *= '9' - s1[i] + 1;
      c2 %= MOD7;
      c3 %= MOD7;
    }
  }
  cout << (c1 - c2 - c3 + c4 + 1ll * MOD7 * 3) % MOD7;
}
