#include <bits/stdc++.h>
using namespace std;
char s1[100010];
char s2[100010];
long long mod = 1000000007;
long long pow2(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    ans %= mod;
    a *= a;
    a %= mod;
    b = b >> 1;
  }
  return ans;
}
int main() {
  int len;
  scanf("%d", &len);
  scanf("%s", &s1);
  scanf("%s", &s2);
  int curr = 0;
  for (int i = 0; i < len; i++) {
    if (s1[i] == '?') curr++;
    if (s2[i] == '?') curr++;
  }
  long long ans = 1;
  ans = pow2(10, curr);
  long long cnt1 = 1, cnt2 = 1, cnt3 = 1;
  bool flag1 = 1, flag2 = 1, flag3 = 1;
  for (int i = 0; i < len; i++) {
    if (s1[i] == '?' && s2[i] == '?') {
      cnt1 = cnt1 * 55 % mod;
    } else if (s1[i] == '?' && s2[i] != '?') {
      cnt1 = cnt1 * (10 - (s2[i] - '0')) % mod;
    } else if (s1[i] != '?' && s2[i] == '?') {
      cnt1 = cnt1 * (s1[i] - '0' + 1) % mod;
    } else {
      if (s1[i] >= s2[i])
        cnt1 *= 1;
      else {
        flag1 = 0;
        break;
      }
    }
  }
  for (int i = 0; i < len; i++) {
    if (s1[i] == '?' && s2[i] == '?') {
      cnt2 = cnt2 * 55 % mod;
    } else if (s1[i] == '?' && s2[i] != '?') {
      cnt2 = cnt2 * (s2[i] - '0' + 1) % mod;
    } else if (s1[i] != '?' && s2[i] == '?') {
      cnt2 = cnt2 * (10 - (s1[i] - '0')) % mod;
    } else {
      if (s1[i] <= s2[i])
        cnt2 *= 1;
      else {
        flag2 = 0;
        break;
      }
    }
  }
  if (!flag1 && !flag2) {
    printf("%d\n", ans);
    return 0;
  }
  for (int i = 0; i < len; i++) {
    if (s1[i] == '?' && s2[i] == '?') {
      cnt3 = cnt3 * 10 % mod;
    } else if (s1[i] == '?' && s2[i] != '?') {
      cnt3 = cnt3 * 1;
    } else if (s1[i] != '?' && s2[i] == '?') {
      cnt3 = cnt3 * 1;
    } else {
      if (s1[i] == s2[i])
        cnt3 *= 1;
      else {
        flag3 = 0;
        break;
      }
    }
  }
  if (!flag1) {
    ans = ((ans - cnt2) % mod + mod) % mod;
  } else if (!flag2) {
    ans = ((ans - cnt1) % mod + mod) % mod;
  } else {
    ans = ((ans - cnt1 - cnt2 + cnt3) % mod + mod) % mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
