#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long MOD = 1e9 + 7;
long long dp[4][N];
char a[N], b[N];
int n;
long long part_eq(char x, char y) {
  if (x == '?' && y == '?') return 10;
  if (x == '?' || y == '?') return 1;
  return x == y;
}
long long part_gt(char x, char y) {
  if (x == '?' && y == '?') return 45;
  if (x == '?') return y - '0';
  if (y == '?') return 9 - (x - '0');
  return x < y;
}
long long part_lt(char x, char y) { return part_gt(y, x); }
long long part_free(char x, char y) {
  int r = 1;
  if (x == '?') r *= 10;
  if (y == '?') r *= 10;
  return r;
}
int main(void) {
  scanf("%d", &n);
  scanf("%s%s", a + 1, b + 1);
  dp[0][0] = 1;
  dp[1][0] = dp[2][0] = dp[3][0] = 0;
  for (int i = 1; i <= n; i++)
    dp[0][i] = dp[0][i - 1] * part_eq(a[i], b[i]) % MOD;
  for (int i = 1; i <= n; i++)
    dp[1][i] = (dp[1][i - 1] * part_eq(a[i], b[i]) +
                (dp[0][i - 1] + dp[1][i - 1]) * part_lt(a[i], b[i])) %
               MOD;
  for (int i = 1; i <= n; i++)
    dp[2][i] = dp[1][i - 1] * part_gt(a[i], b[i]) % MOD;
  for (int i = 1; i <= n; i++)
    dp[3][i] = (dp[3][i - 1] * part_free(a[i], b[i]) + dp[2][i]) % MOD;
  long long ans = dp[3][n];
  dp[0][0] = 1;
  dp[1][0] = dp[2][0] = dp[3][0] = 0;
  for (int i = 1; i <= n; i++)
    dp[0][i] = dp[0][i - 1] * part_eq(a[i], b[i]) % MOD;
  for (int i = 1; i <= n; i++)
    dp[1][i] = (dp[1][i - 1] * part_eq(a[i], b[i]) +
                (dp[0][i - 1] + dp[1][i - 1]) * part_gt(a[i], b[i])) %
               MOD;
  for (int i = 1; i <= n; i++)
    dp[2][i] = dp[1][i - 1] * part_lt(a[i], b[i]) % MOD;
  for (int i = 1; i <= n; i++)
    dp[3][i] = (dp[3][i - 1] * part_free(a[i], b[i]) + dp[2][i]) % MOD;
  ans = (ans + dp[3][n]) % MOD;
  printf("%I64d\n", ans);
  return 0;
}
