#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long int mod = 1e9 + 7;
long long int n;
string a, b;
unordered_map<char, long long int> cntB, cntM;
long long int fullB = 0, fullM = 0, fullR = 0;
void init() {
  for (char c = '0'; c <= '9'; ++c) {
    for (char v = '0'; v <= '9'; ++v) {
      if (c > v)
        ++cntM[c];
      else if (c < v)
        ++cntB[c];
      else
        ++fullR;
    }
    fullB += cntB[c];
    fullM += cntM[c];
  }
}
signed main() {
  init();
  cin >> n >> a >> b;
  a = "#" + a;
  b = "#" + b;
  vector<vector<vector<long long int>>> dp(
      n + 1, vector<vector<long long int>>(2, vector<long long int>(2, 0)));
  dp[0][0][0] = 1;
  for (long long int i = 1; i <= n; ++i) {
    if (a[i] == '?' && b[i] == '?') {
      dp[i][0][0] = (dp[i - 1][0][0] * fullR) % mod;
      dp[i][0][1] =
          (dp[i - 1][0][0] * fullM + dp[i - 1][0][1] * (fullM + fullR)) % mod;
      dp[i][1][0] =
          (dp[i - 1][0][0] * fullB + dp[i - 1][1][0] * (fullB + fullR)) % mod;
      dp[i][1][1] = (dp[i - 1][1][1] * (fullM + fullB + fullR) +
                     dp[i - 1][0][1] * fullB + dp[i - 1][1][0] * fullM) %
                    mod;
    } else if (a[i] == '?') {
      dp[i][0][0] = dp[i - 1][0][0];
      dp[i][0][1] =
          (dp[i - 1][0][0] * cntM[b[i]] + dp[i - 1][0][1] * (cntM[b[i]] + 1)) %
          mod;
      dp[i][1][0] =
          (dp[i - 1][0][0] * cntB[b[i]] + dp[i - 1][1][0] * (cntB[b[i]] + 1)) %
          mod;
      dp[i][1][1] =
          (dp[i - 1][1][1] * (cntM[b[i]] + cntB[b[i]] + 1) +
           dp[i - 1][0][1] * cntB[b[i]] + dp[i - 1][1][0] * cntM[b[i]]) %
          mod;
    } else if (b[i] == '?') {
      dp[i][0][0] = dp[i - 1][0][0];
      dp[i][0][1] =
          (dp[i - 1][0][0] * cntB[a[i]] + dp[i - 1][0][1] * (cntB[a[i]] + 1)) %
          mod;
      dp[i][1][0] =
          (dp[i - 1][0][0] * cntM[a[i]] + dp[i - 1][1][0] * (cntM[a[i]] + 1)) %
          mod;
      dp[i][1][1] =
          (dp[i - 1][1][1] * (cntM[a[i]] + cntB[a[i]] + 1) +
           dp[i - 1][0][1] * cntM[a[i]] + dp[i - 1][1][0] * cntB[a[i]]) %
          mod;
    } else {
      if (a[i] == b[i]) {
        dp[i][0][0] = dp[i - 1][0][0];
        dp[i][0][1] = dp[i - 1][0][1];
        dp[i][1][0] = dp[i - 1][1][0];
        dp[i][1][1] = dp[i - 1][1][1];
      } else if (a[i] < b[i]) {
        dp[i][0][0] = 0;
        dp[i][0][1] = (dp[i - 1][0][0] + dp[i - 1][0][1]) % mod;
        dp[i][1][0] = 0;
        dp[i][1][1] = (dp[i - 1][1][1] + dp[i - 1][1][0]) % mod;
      } else {
        dp[i][0][0] = 0;
        dp[i][0][1] = 0;
        dp[i][1][0] = (dp[i - 1][0][0] + dp[i - 1][1][0]) % mod;
        dp[i][1][1] = (dp[i - 1][1][1] + dp[i - 1][0][1]) % mod;
      }
    }
  }
  cout << dp[n][1][1] << "\n";
  return 0;
}
