#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char a[100100], b[100100];
bool check(char ch) { return (ch >= '0' && ch <= '9') || (ch == '?'); }
long long f[100100][2];
long long cnt = 0;
long long ksm(long long a, long long b) {
  long long ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = (ans * a) % mod;
    a = a * a % mod;
  }
  return ans;
}
long long g[100100];
int main() {
  int n = read();
  for (int i = 1; i <= n; ++i) {
    char ch = getchar();
    while (!check(ch)) ch = getchar();
    a[i] = ch;
    if (a[i] == '?') cnt++;
  }
  for (int i = 1; i <= n; ++i) {
    char ch = getchar();
    while (!check(ch)) ch = getchar();
    b[i] = ch;
    if (b[i] == '?') cnt++;
  }
  f[0][0] = 1;
  f[0][1] = 1;
  g[0] = 1;
  for (int i = 1; i <= n; ++i) {
    if ('0' <= a[i] && a[i] <= '9' && '0' <= b[i] && b[i] <= '9') {
      if (a[i] >= b[i]) {
        f[i][0] = f[i - 1][0] % mod;
      }
      if (a[i] <= b[i]) {
        f[i][1] = f[i - 1][1] % mod;
      }
      if (a[i] == b[i]) g[i] = g[i - 1];
    } else {
      if (a[i] == '?' && b[i] == '?') {
        f[i][0] = f[i - 1][0] * 55 % mod;
        f[i][1] = f[i - 1][1] * 55 % mod;
        g[i] = g[i - 1] * 10 % mod;
      } else if (a[i] == '?') {
        f[i][0] = f[i - 1][0] * ('9' - b[i] + 1) % mod;
        f[i][1] = f[i - 1][1] * (b[i] - '0' + 1) % mod;
        g[i] = g[i - 1];
      } else {
        f[i][0] = f[i - 1][0] * (a[i] - '0' + 1) % mod;
        f[i][1] = f[i - 1][1] * ('9' - a[i] + 1) % mod;
        g[i] = g[i - 1];
      }
    }
  }
  long long ans = ksm(10, cnt);
  ans = (ans - f[n][0] - f[n][1] + g[n]) % mod;
  cout << (ans + mod) % mod << endl;
}
