#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int n;
string a, b;
long long Mod = 1000000007;
int md;
long long ans;
long long cc(int md) {
  long long ans = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] != '?' && b[i] != '?') continue;
    if (a[i] != '?') {
      if (md == 1)
        ans = (ans * ('9' - a[i] + 1)) % Mod;
      else
        ans = (ans * (a[i] - '0' + 1)) % Mod;
    } else {
      if (b[i] != '?') {
        if (md == 1)
          ans = (ans * (b[i] - '0' + 1)) % Mod;
        else
          ans = (ans * ('9' - b[i] + 1)) % Mod;
      } else
        ans = (ans * 55) % Mod;
    }
  }
  return ans;
}
long long tot, sum;
int main() {
  cin >> n;
  cin >> a >> b;
  sum = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == '?') sum = (sum * 10) % Mod;
    if (b[i] == '?') sum = (sum * 10) % Mod;
  }
  md = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '?' || b[i] == '?') continue;
    if (a[i] < b[i]) {
      if (md == 0) md = 1;
      if (md == 2) md = 3;
    }
    if (a[i] > b[i]) {
      if (md == 0) md = 2;
      if (md == 1) md = 3;
    }
  }
  if (md == 3) {
    cout << sum << endl;
    return 0;
  }
  ans = 1;
  tot = 1;
  for (int i = 0; i < n; i++)
    if (a[i] == '?' && b[i] == '?') tot = (tot * 10) % Mod;
  if (md == 0)
    ans = (cc(1) + cc(2) - tot + Mod) % Mod;
  else
    ans = cc(md);
  ans = (sum - ans + Mod) % Mod;
  cout << ans << endl;
  return 0;
}
