#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, mod = 1e9 + 7;
char p[maxn], q[maxn];
int n, num = 0;
int prework() {
  bool flag1 = 0, flag2 = 0;
  for (int i = 0; i < n; ++i) {
    if (p[i] == '?') ++num;
    if (q[i] == '?') ++num;
    if (p[i] != '?' && q[i] != '?') {
      if (p[i] < q[i])
        flag1 = 1;
      else if (p[i] > q[i])
        flag2 = 1;
    }
  }
  if (flag1 && flag2) return 1;
  if (flag1 && !flag2) return 2;
  if (!flag1 && flag2) return 3;
  return 4;
}
int main() {
  scanf("%d", &n);
  scanf("%s%s", p, q);
  int key = prework();
  long long tot = 1;
  for (int i = 0; i < num; ++i) tot = (tot * 10) % mod;
  long long ans;
  if (key == 1)
    ans = tot;
  else if (key == 2) {
    long long tmp = 1;
    for (int i = 0; i < n; ++i) {
      if (p[i] == '?' && q[i] == '?')
        tmp = (tmp * 55) % mod;
      else if (p[i] != '?' && q[i] == '?')
        tmp = (tmp * (9 - (p[i] - '0') + 1)) % mod;
      else if (p[i] == '?' && q[i] != '?')
        tmp = (tmp * (q[i] - '0' + 1)) % mod;
    }
    ans = ((tot - tmp) % mod + mod) % mod;
  } else if (key == 3) {
    long long tmp = 1;
    for (int i = 0; i < n; ++i) {
      if (p[i] == '?' && q[i] == '?')
        tmp = (tmp * 55) % mod;
      else if (p[i] != '?' && q[i] == '?')
        tmp = (tmp * (p[i] - '0' + 1)) % mod;
      else if (p[i] == '?' && q[i] != '?')
        tmp = (tmp * (9 - (q[i] - '0') + 1)) % mod;
    }
    ans = ((tot - tmp) % mod + mod) % mod;
  } else {
    long long tmp1 = 1, tmp2 = 1, tmp3 = 1;
    for (int i = 0; i < n; ++i) {
      if (p[i] == '?' && q[i] == '?')
        tmp1 = (tmp1 * 55) % mod;
      else if (p[i] != '?' && q[i] == '?')
        tmp1 = (tmp1 * (9 - (p[i] - '0') + 1)) % mod;
      else if (p[i] == '?' && q[i] != '?')
        tmp1 = (tmp1 * (q[i] - '0' + 1)) % mod;
    }
    for (int i = 0; i < n; ++i) {
      if (p[i] == '?' && q[i] == '?')
        tmp2 = (tmp2 * 55) % mod;
      else if (p[i] != '?' && q[i] == '?')
        tmp2 = (tmp2 * (p[i] - '0' + 1)) % mod;
      else if (p[i] == '?' && q[i] != '?')
        tmp2 = (tmp2 * (9 - (q[i] - '0') + 1)) % mod;
    }
    for (int i = 0; i < n; ++i) {
      if (p[i] == '?' && q[i] == '?')
        tmp3 = (tmp3 * 10) % mod;
      else if (p[i] != '?' && q[i] != '?' && p[i] != q[i]) {
        tmp3 = 0;
        break;
      }
    }
    ans = ((tot - tmp1 - tmp2 + tmp3) % mod + mod) % mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
