#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 1;
const long long mod = 1e9 + 7;
const int maxn = 1e5 + 5;
long long n, i, flag1, flag2, res, c[maxn], d[maxn], e[maxn], kq(1), bang(1);
bool ok = false, ok2 = true;
char a[maxn], b[maxn];
void Init() {
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> a[i];
  for (i = 1; i <= n; ++i) cin >> b[i];
  for (i = 1; i <= n; ++i)
    if (a[i] != '?' && b[i] != '?') {
      if (a[i] - '0' < b[i] - '0') flag1 = 1, ok2 = false;
      if (a[i] - '0' > b[i] - '0') flag2 = 1, ok2 = false;
    }
}
void Solve() {
  for (i = 1; i <= n; ++i) {
    if (a[i] != '?' && b[i] != '?')
      c[i] = d[i] = e[i] = 1;
    else {
      ok = true;
      if (a[i] == '?' && b[i] == '?') {
        c[i] = d[i] = 55;
        e[i] = 100;
        bang = bang * 10 % mod;
      } else {
        if (a[i] == '?') {
          c[i] = b[i] - '0' + 1;
          d[i] = 9 - (b[i] - '0') + 1;
        } else {
          c[i] = 9 - (a[i] - '0') + 1;
          d[i] = a[i] - '0' + 1;
        }
        e[i] = 10;
      }
      kq = (kq * e[i]) % mod;
    }
  }
  long long ans = 1;
  if (!flag2) {
    for (i = 1; i <= n; ++i) ans = (ans * c[i]) % mod;
    res = (res + ans) % mod;
  }
  ans = 1;
  if (!flag1) {
    for (i = 1; i <= n; ++i) ans = (ans * d[i]) % mod;
    res = (res + ans) % mod;
  }
  if (ok && ok2) res = (res - bang + mod) % mod;
  res %= mod;
  cout << (kq - res + mod) % mod;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  Init();
  Solve();
}
