#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010, mod = 1e9 + 7;
int n, ans, cnt;
char s[maxn], t[maxn];
int qpow(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) res = 1ll * res * a % mod;
  return res;
}
void dec(int& a, int b) {
  a -= b;
  if (a < 0) a += mod;
}
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (int i = (int)1; i <= (int)n; i++) cnt += (s[i] == '?') + (t[i] == '?');
  ans = qpow(10, cnt);
  int tmp = 1;
  for (int i = (int)1; i <= (int)n; i++) {
    if (s[i] != '?' && t[i] != '?' && s[i] > t[i])
      tmp = 0;
    else if (s[i] == '?' && t[i] != '?')
      tmp = 1ll * tmp * (t[i] - '0' + 1) % mod;
    else if (s[i] != '?' && t[i] == '?')
      tmp = 1ll * tmp * (10 + '0' - s[i]) % mod;
    else if (s[i] == '?' && t[i] == '?')
      tmp = 1ll * tmp * 55 % mod;
  }
  dec(ans, tmp);
  tmp = 1;
  for (int i = (int)1; i <= (int)n; i++) {
    if (s[i] != '?' && t[i] != '?' && s[i] < t[i])
      tmp = 0;
    else if (s[i] == '?' && t[i] != '?')
      tmp = 1ll * tmp * (10 + '0' - t[i]) % mod;
    else if (s[i] != '?' && t[i] == '?')
      tmp = 1ll * tmp * (s[i] - '0' + 1) % mod;
    else if (s[i] == '?' && t[i] == '?')
      tmp = 1ll * tmp * 55 % mod;
  }
  dec(ans, tmp);
  tmp = 1;
  for (int i = (int)1; i <= (int)n; i++) {
    if (s[i] != '?' && t[i] != '?' && s[i] != t[i])
      tmp = 0;
    else if (s[i] == '?' && t[i] == '?')
      tmp = 1ll * tmp * 10 % mod;
  }
  ans = (ans + tmp) % mod;
  printf("%d\n", ans);
  return 0;
}
