#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string s, w;
  cin >> s >> w;
  bool sgw = false, wgs = false;
  long long totAns = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] != '?' && w[i] != '?') {
      if (s[i] > w[i]) sgw = true;
      if (s[i] < w[i]) wgs = true;
    }
    if (s[i] == '?') totAns *= 10;
    totAns %= 1000000007;
    if (w[i] == '?') totAns *= 10;
    totAns %= 1000000007;
  }
  long long sgewans = 0;
  long long seqw = 0;
  if (!wgs) {
    sgewans = 1;
    if (!wgs && !sgw) seqw = 1;
    for (int i = 0; i < n; i++) {
      if (s[i] == '?') {
        if (w[i] == '?') {
          sgewans *= 55;
          seqw *= 10;
        } else {
          sgewans *= '9' - w[i] + 1;
        }
      } else {
        if (w[i] == '?') {
          sgewans *= s[i] - '0' + 1;
        }
      }
      sgewans %= 1000000007;
      seqw %= 1000000007;
    }
  }
  long long wgesans = 0;
  if (!sgw) {
    wgesans = 1;
    for (int i = 0; i < n; i++) {
      if (w[i] == '?') {
        if (s[i] == '?') {
          wgesans *= 55;
        } else {
          wgesans *= '9' - s[i] + 1;
        }
      } else {
        if (s[i] == '?') {
          wgesans *= w[i] - '0' + 1;
        }
      }
      wgesans %= 1000000007;
    }
  }
  long long ans = 0;
  ans += sgewans;
  ans += wgesans;
  ans %= 1000000007;
  ans -= seqw;
  ans %= 1000000007;
  if (ans < 0) ans += 1000000007;
  ans = totAns - ans;
  ans %= 1000000007;
  if (ans < 0) ans += 1000000007;
  cout << ans << endl;
}
