#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
int n;
string s1, s2;
int dp[N];
int calc(string s1, string s2) {
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    dp[i + 1] = dp[i];
    if (s1[i] != '?' && s2[i] != '?') {
      if (s1[i] < s2[i]) return 0;
      continue;
    }
    if (s1[i] == '?' && s2[i] == '?') {
      dp[i + 1] = dp[i + 1] * 1ll * 55 % mod;
    } else if (s1[i] == '?') {
      dp[i + 1] = dp[i + 1] * 1ll * ('9' - s2[i] + 1) % mod;
    } else {
      dp[i + 1] = dp[i + 1] * 1ll * (s1[i] - '0' + 1) % mod;
    }
  }
  return dp[n];
}
int calc2(string s1, string s2) {
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    dp[i + 1] = dp[i];
    if (s1[i] != '?' && s2[i] != '?') {
      if (s1[i] != s2[i]) return 0;
      continue;
    }
    if (s1[i] == '?' && s2[i] == '?') {
      dp[i + 1] = dp[i + 1] * 1ll * 10 % mod;
    }
  }
  return dp[n];
}
int main() {
  cin >> n >> s1 >> s2;
  int tot = 1;
  for (int i = 0; i < n; ++i) {
    if (s1[i] == '?' && s2[i] == '?')
      tot = (tot * 1ll * 100) % mod;
    else if (s1[i] == '?')
      tot = (tot * 1ll * 10) % mod;
    else if (s2[i] == '?')
      tot = (tot * 1ll * 10) % mod;
  }
  int ans = tot + mod - calc(s1, s2);
  if (ans >= mod) ans -= mod;
  ans = ans + mod - calc(s2, s1);
  if (ans >= mod) ans -= mod;
  ans = ans + calc2(s1, s2);
  if (ans >= mod) ans -= mod;
  cout << ans << '\n';
}
