#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100100;
const int M = 4;
const int MOD = 1000000007;
const int INF = 1 << 28;
const int EPS = 1e-9;
int n;
string s, t;
int dp[MAX_N][M];
int solve() {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = (0); i < (n); i++) {
    if (s[i] != '?' && t[i] != '?') {
      if (s[i] < t[i]) {
        dp[i + 1][1] = (dp[i][1] + dp[i][0]) % MOD;
        dp[i + 1][3] = (dp[i][3] + dp[i][2]) % MOD;
      } else if (s[i] > t[i]) {
        dp[i + 1][2] = (dp[i][2] + dp[i][0]) % MOD;
        dp[i + 1][3] = (dp[i][3] + dp[i][1]) % MOD;
      } else {
        dp[i + 1][0] = dp[i][0];
        dp[i + 1][1] = dp[i][1];
        dp[i + 1][2] = dp[i][2];
        dp[i + 1][3] = dp[i][3];
      }
    } else if (s[i] == '?' && t[i] != '?') {
      dp[i + 1][0] = dp[i][0];
      dp[i + 1][1] = ((long long)dp[i][0] * (t[i] - '0') +
                      (long long)dp[i][1] * (t[i] - '0' + 1)) %
                     MOD;
      dp[i + 1][2] = ((long long)dp[i][0] * ('9' - t[i]) +
                      (long long)dp[i][2] * ('9' - t[i] + 1)) %
                     MOD;
      dp[i + 1][3] =
          ((long long)dp[i][1] * ('9' - t[i]) +
           (long long)dp[i][2] * (t[i] - '0') + (long long)dp[i][3] * 10) %
          MOD;
    } else if (t[i] == '?' && s[i] != '?') {
      dp[i + 1][0] = dp[i][0];
      dp[i + 1][1] = ((long long)dp[i][0] * ('9' - s[i]) +
                      (long long)dp[i][1] * ('9' - s[i] + 1)) %
                     MOD;
      dp[i + 1][2] = ((long long)dp[i][0] * (s[i] - '0') +
                      (long long)dp[i][2] * (s[i] - '0' + 1)) %
                     MOD;
      dp[i + 1][3] =
          ((long long)dp[i][1] * (s[i] - '0') +
           (long long)dp[i][2] * ('9' - s[i]) + (long long)dp[i][3] * 10) %
          MOD;
    } else {
      dp[i + 1][0] = ((long long)dp[i][0] * 10) % MOD;
      dp[i + 1][1] =
          ((long long)dp[i][0] * 45 + (long long)dp[i][1] * 55) % MOD;
      dp[i + 1][2] =
          ((long long)dp[i][0] * 45 + (long long)dp[i][2] * 55) % MOD;
      dp[i + 1][3] = ((long long)dp[i][1] * 45 + (long long)dp[i][2] * 45 +
                      (long long)dp[i][3] * 100) %
                     MOD;
    }
  }
  return dp[n][3];
}
int main() {
  cin >> n;
  cin >> s >> t;
  cout << solve() << endl;
  return 0;
}
