#include <bits/stdc++.h>
using namespace std;
inline int Rint() {
  int x;
  scanf("%d", &x);
  return x;
}
const int MOD = 1e9 + 7;
const int MAXN = 1e5 + 10;
int alll(char* str_a, char* str_b, int n) {
  int ret = 1;
  for (int i = 0; i < n; ++i) {
    if (str_a[i] == '?') ret = ret * 10ll % MOD;
    if (str_b[i] == '?') ret = ret * 10ll % MOD;
  }
  return ret;
}
int upp(char* str_a, char* str_b, int n) {
  int ans = 1;
  for (int i = 0; i < n; ++i) {
    if (str_a[i] == str_b[i]) {
      if (str_a[i] != '?')
        ;
      else
        ans = ans * 55ll % MOD;
    } else if (str_a[i] == '?') {
      ans = ans * (long long)('9' - str_b[i] + 1) % MOD;
    } else if (str_b[i] == '?') {
      ans = ans * (long long)(str_a[i] - '0' + 1) % MOD;
    } else if (str_a[i] >= str_b[i]) {
    } else
      return 0;
  }
  return ans;
}
int equ(char* str_a, char* str_b, int n) {
  int ret = 1;
  for (int i = 0; i < n; ++i)
    if (str_a[i] == '?' || str_b[i] == '?') {
      if (str_a[i] == '?' && str_b[i] == '?') ret = ret * 10ll % MOD;
    } else if (str_a[i] != str_b[i])
      return 0;
  return ret;
}
int n;
char str_a[MAXN], str_b[MAXN];
int main() {
  while (cin >> n) {
    scanf("%s", str_a);
    scanf("%s", str_b);
    int all = alll(str_a, str_b, n);
    int mod1 = upp(str_a, str_b, n);
    int mod2 = upp(str_b, str_a, n);
    int mod3 = equ(str_a, str_b, n);
    int ans = ((mod1 + mod2 - mod3) % MOD + MOD) % MOD;
    ans = (all - ans + MOD) % MOD;
    printf("%d\n", ans);
  }
  return 0;
}
