#include <bits/stdc++.h>
using namespace std;
int N, dp[100005][3], MOD = 1000000007;
char s[2][100005];
long long ans = 1;
int main() {
  scanf("%d%s%s", &N, s[0], s[1]);
  for (int i = 0; i < N; ++i) {
    if (s[0][i] == '?') ans = (((ans * 10) % (MOD) + (MOD)) % (MOD));
    if (s[1][i] == '?') ans = (((ans * 10) % (MOD) + (MOD)) % (MOD));
    for (int x = 0; x < 10; ++x) {
      for (int y = 0; y < 10; ++y) {
        if ((s[0][i] == '?' || s[0][i] == x + '0') &&
            (s[1][i] == '?' || s[1][i] == y + '0')) {
          if (x >= y) {
            dp[i][0] =
                (((dp[i][0] + (i ? dp[i - 1][0] : 1)) % (MOD) + (MOD)) % (MOD));
          }
          if (x <= y) {
            dp[i][1] =
                (((dp[i][1] + (i ? dp[i - 1][1] : 1)) % (MOD) + (MOD)) % (MOD));
          }
          if (x == y) {
            dp[i][2] =
                (((dp[i][2] + (i ? dp[i - 1][2] : 1)) % (MOD) + (MOD)) % (MOD));
          }
        }
      }
    }
  }
  if (N == 1)
    puts("0");
  else
    printf(
        "%d\n",
        (((ans - dp[N - 1][0] - dp[N - 1][1] + dp[N - 1][2]) % (MOD) + (MOD)) %
         (MOD)));
  return 0;
}
