#include <bits/stdc++.h>
using namespace std;
int dp[100005][4];
int n;
string a, b;
int aa = 0, bb = 0, cc = 0;
long long DP(int i, int c) {
  if (i == n) return (c == 3);
  if (dp[i][c] != -1) return dp[i][c];
  if (a[i] != '?' and b[i] != '?') {
    if (b[i] > a[i]) return DP(i + 1, c | 2);
    if (a[i] > b[i]) return DP(i + 1, c | 1);
    return DP(i + 1, c);
  }
  long long ans;
  if (b[i] != '?')
    ans = (('9' - b[i]) * DP(i + 1, c | 1)) % 1000000007 +
          ((b[i] - '0') * DP(i + 1, c | 2)) % 1000000007 +
          DP(i + 1, c) % 1000000007;
  else if (a[i] != '?')
    ans = ((a[i] - '0') * DP(i + 1, c | 1)) % 1000000007 +
          (('9' - a[i]) * DP(i + 1, c | 2)) % 1000000007 +
          DP(i + 1, c) % 1000000007;
  else
    ans = (aa * DP(i + 1, c | 1)) % 1000000007 +
          (bb * DP(i + 1, c | 2)) % 1000000007 +
          (cc * DP(i + 1, c)) % 1000000007;
  return dp[i][c] = (ans % 1000000007);
}
int main() {
  cin >> n;
  memset(dp, -1, sizeof dp);
  cin >> a >> b;
  for (int i = 0; i <= 9; i++)
    for (int j = 0; j <= 9; j++) {
      if (i == j) cc++;
      if (i < j) bb++;
      if (j > i) aa++;
    }
  cout << DP(0, 0) << endl;
}
