#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long n, i, j, pw = 1, ans1, ans2, diff = 1;
char a[100000], b[100000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  ans1 = ans2 = 1;
  for (i = 0; i < n; i++) {
    if (a[i] == '?') pw = (pw * 10) % mod;
    if (b[i] == '?') pw = (pw * 10) % mod;
    if (a[i] == '?' && b[i] == '?')
      ans1 = (ans1 * 55) % mod, ans2 = (ans2 * 55) % mod, diff *= 10;
    else {
      if (a[i] == '?' || b[i] == '?') {
        if (a[i] == '?')
          ans1 = (ans1 * ('9' - b[i] + 1)) % mod,
          ans2 = (ans2 * (b[i] - '0' + 1)) % mod;
        else
          ans2 = (ans2 * ('9' - a[i] + 1)) % mod,
          ans1 = (ans1 * (a[i] - '0' + 1)) % mod;
      } else {
        if (a[i] < b[i]) ans1 = 0, diff = 0;
        if (a[i] > b[i]) ans2 = 0, diff = 0;
      }
    }
  }
  cout << (pw - ans1 - ans2 + 3 * mod + diff) % mod;
  return 0;
}
