#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long i, j, k, x, y, z, n, m, ans;
char a[100001], b[100001];
bool bigger, smaller;
int main() {
  scanf("%I64d", &n);
  scanf("%s%s", a, b);
  bigger = smaller = false;
  for (i = 0; i < n; ++i)
    if (a[i] != '?' && b[i] != '?') {
      if (a[i] < b[i]) smaller = true;
      if (a[i] > b[i]) bigger = true;
    }
  ans = 1;
  for (i = 0; i < n; ++i) {
    if (a[i] == '?') ans = (ans * 10) % mod;
    if (b[i] == '?') ans = (ans * 10) % mod;
  }
  long long ret = 1, rett;
  for (i = 0; i < n; ++i)
    if (a[i] == '?')
      if (b[i] == '?')
        ret = (ret * 55) % mod;
      else
        ret = (ret * (b[i] - 47)) % mod;
    else if (b[i] == '?')
      ret = (ret * (58 - a[i])) % mod;
  rett = ret;
  ret = 1;
  for (i = 0; i < n; ++i)
    if (a[i] == '?')
      if (b[i] == '?')
        ret = (ret * 55) % mod;
      else
        ret = (ret * (58 - b[i])) % mod;
    else if (b[i] == '?')
      ret = (ret * (a[i] - 47)) % mod;
  long long pl = 1;
  for (i = 0; i < n; ++i) {
    if (a[i] == '?' && b[i] == '?') pl = (pl * 10) % mod;
    if (a[i] != '?' && b[i] != '?' && a[i] != b[i]) pl = 0;
  }
  if (!smaller) ans = (ans - ret + mod) % mod;
  if (!bigger) ans = (ans - rett + mod) % mod;
  if (!smaller && !bigger) ans = (ans + pl) % mod;
  printf("%I64d\n", ans);
  return 0;
}
