#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 10000000;
long long res[100005][2][2];
char s[100005], t[100005];
int n;
long long solve(int i, bool a, bool b) {
  long long &ans = res[i][a][b];
  if (ans != -1) return ans;
  if (i == n) return ans = (a && b);
  ans = 0;
  if (s[i] == '?' && t[i] == '?') {
    ans = (ans + 10 * solve(i + 1, a, b)) % 1000000007;
    ans = (ans + 45 * solve(i + 1, 1, b)) % 1000000007;
    ans = (ans + 45 * solve(i + 1, a, 1)) % 1000000007;
  } else if (s[i] == '?') {
    int x = t[i] - '0';
    ans = (ans + solve(i + 1, a, b)) % 1000000007;
    ans = (ans + (9 - x) * solve(i + 1, 1, b)) % 1000000007;
    ans = (ans + x * solve(i + 1, a, 1)) % 1000000007;
  } else if (t[i] == '?') {
    int x = s[i] - '0';
    ans = (ans + solve(i + 1, a, b)) % 1000000007;
    ans = (ans + (9 - x) * solve(i + 1, a, 1)) % 1000000007;
    ans = (ans + x * solve(i + 1, 1, b)) % 1000000007;
  } else {
    if (s[i] > t[i])
      ans = (ans + solve(i + 1, 1, b)) % 1000000007;
    else if (s[i] < t[i])
      ans = (ans + solve(i + 1, a, 1)) % 1000000007;
    else
      ans = (ans + solve(i + 1, a, b)) % 1000000007;
  }
  return ans;
}
int main() {
  cin >> n;
  scanf("%s", &s);
  scanf("%s", &t);
  memset((res), (-1), sizeof(res));
  cout << solve(0, 0, 0) << endl;
  return 0;
}
