#include <bits/stdc++.h>
using namespace std;
const int N = 100006;
const int MOD = 1000000007;
char S[N], W[N];
int n, cnt;
long long calMax() {
  long long res = 1;
  for (int i = 0; i < n; i++) {
    if (S[i] != '?' && W[i] != '?') {
      if (S[i] >= W[i])
        res *= 1;
      else
        res *= 0;
      continue;
    }
    if (S[i] != '?')
      res = (res * (S[i] - '0' + 1)) % MOD;
    else if (W[i] != '?')
      res = (res * ('9' - W[i] + 1)) % MOD;
    else
      res = (res * 55) % MOD;
  }
  return res;
}
long long calMin() {
  long long res = 1;
  for (int i = 0; i < n; i++) {
    if (S[i] != '?' && W[i] != '?') {
      if (S[i] <= W[i])
        res *= 1;
      else
        res *= 0;
      continue;
    }
    if (S[i] != '?')
      res = res * ('9' - S[i] + 1) % MOD;
    else if (W[i] != '?')
      res = res * (W[i] - '0' + 1) % MOD;
    else
      res = res * 55 % MOD;
  }
  return res;
}
long long calEqu() {
  long long res = 1;
  for (int i = 0; i < n; i++) {
    if (S[i] != '?' || W[i] != '?') {
      if (S[i] != '?' && W[i] != '?' && S[i] != W[i]) res = 0;
      continue;
    }
    res = res * 10 % MOD;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  scanf("%s%s", S, W);
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (S[i] == '?') cnt++;
    if (W[i] == '?') cnt++;
  }
  long long ans = 1;
  for (int i = 0; i < cnt; i++) ans = (ans * 10) % MOD;
  long long res1 = calMax(), res2 = calMin(), res3 = calEqu();
  printf("%I64d\n", (ans - res1 - res2 + res3 + MOD + MOD) % MOD);
  return 0;
}
