#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
string s, t;
int n;
long long dp[100005][2][2];
long long solve(int id, int fnd1, int fnd2) {
  if (id == n) {
    if (fnd1 && fnd2) return 1;
    return 0;
  }
  long long ans = 0;
  if (dp[id][fnd1][fnd2] != -1) return dp[id][fnd1][fnd2];
  if (s[id] != '?' && t[id] != '?') {
    int n1 = s[id] - '0';
    int n2 = t[id] - '0';
    if (n1 < n2)
      ans += solve(id + 1, fnd1, 1);
    else if (n1 > n2)
      ans += solve(id + 1, 1, fnd2);
    else
      ans += solve(id + 1, fnd1, fnd2);
    ans %= (long long)(1000 * 1000 * 1000 + 7);
  } else if (s[id] != '?' && t[id] == '?') {
    int n1 = s[id] - '0';
    for (int n2 = 0; n2 < 10; n2++) {
      if (n1 < n2)
        ans += solve(id + 1, fnd1, 1);
      else if (n1 > n2)
        ans += solve(id + 1, 1, fnd2);
      else
        ans += solve(id + 1, fnd1, fnd2);
      ans %= (long long)(1000 * 1000 * 1000 + 7);
    }
  } else if (t[id] != '?' && s[id] == '?') {
    int n2 = t[id] - '0';
    for (int n1 = 0; n1 < 10; n1++) {
      if (n1 < n2)
        ans += solve(id + 1, fnd1, 1);
      else if (n1 > n2)
        ans += solve(id + 1, 1, fnd2);
      else
        ans += solve(id + 1, fnd1, fnd2);
      ans %= (long long)(1000 * 1000 * 1000 + 7);
    }
  } else {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        if (i < j)
          ans += solve(id + 1, fnd1, 1);
        else if (i > j)
          ans += solve(id + 1, 1, fnd2);
        else
          ans += solve(id + 1, fnd1, fnd2);
        ans %= (long long)(1000 * 1000 * 1000 + 7);
      }
    }
  }
  return dp[id][fnd1][fnd2] = (ans % (long long)(1000 * 1000 * 1000 + 7));
}
int main() {
  cin >> n;
  cin >> s >> t;
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0);
}
