#include <bits/stdc++.h>
using namespace std;
const unsigned _mod = 998244353;
const unsigned mod = 1e9 + 7;
const long long infi = 0x3f3f3f3f3f3f3f3fll;
const int inf = 0x3f3f3f3f;
long long ksm(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x % mod;
    y >>= 1ll;
    x = x * x % mod;
  }
  return ret;
}
long long qpow(long long x, long long y, long long m) {
  long long ret = 1;
  while (y) {
    if (y & 1ll) ret = ret * x % m;
    y >>= 1ll;
    x = x * x % m;
  }
  return ret;
}
long long _gcd(long long x, long long y) { return y ? _gcd(y, x % y) : x; }
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, x = 1, y = 1, z = 1, ans = 1;
string a, b;
int main() {
  cin >> n >> a >> b;
  for (register int i = 0; i <= n - 1; ++i) {
    if (a[i] == '?') ans = 10 * ans % mod;
    if (b[i] == '?') ans = 10 * ans % mod;
    if (a[i] != '?' && b[i] != '?')
      x = x * (a[i] >= b[i]), y = y * (a[i] <= b[i]), z = z * (a[i] == b[i]);
    if (a[i] != '?' && b[i] == '?')
      x = x * (1 + (a[i] - '0')), y = y * (10 - (a[i] - '0'));
    if (b[i] != '?' && a[i] == '?')
      x = x * (10 - (b[i] - '0')), y = y * ((b[i] - '0') + 1);
    if (a[i] == '?' && b[i] == '?') x = x * 55, y = y * 55, z = z * 10;
    x %= mod, y %= mod, z %= mod;
  }
  ans = ((ans - x - y + z) % mod + mod) % mod;
  cout << ans << '\n';
  return 0;
}
