#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
string a, b;
long long k = 55;
long long g = 100;
long long h = 10;
int main() {
  long long n;
  cin >> n;
  cin >> a >> b;
  long long ok = 0;
  long long big = 1;
  long long sma = 1;
  long long equ = 1;
  long long tot = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] != '?' && b[i] != '?') {
      if (a[i] > b[i]) {
        sma = 0;
        equ = 0;
      }
      if (a[i] < b[i]) {
        big = 0;
        equ = 0;
      }
      continue;
    }
    ok = 1;
    if (a[i] == '?' && b[i] != '?') {
      big = big * ('9' - b[i] + 1) % MOD;
      sma = sma * (b[i] - '0' + 1) % MOD;
      tot = (tot * h) % MOD;
    }
    if (a[i] != '?' && b[i] == '?') {
      big = big * (a[i] - '0' + 1) % MOD;
      sma = sma * ('9' - a[i] + 1) % MOD;
      tot = (tot * h) % MOD;
    }
    if (a[i] == '?' && b[i] == '?') {
      big = (big * k) % MOD;
      sma = (sma * k) % MOD;
      equ = (equ * h) % MOD;
      tot = (tot * g) % MOD;
    }
  }
  if (ok == 0) {
    if (sma == 0 && big == 0) {
      cout << "1" << endl;
    } else
      cout << "0" << endl;
    return 0;
  }
  cout << (tot - big - sma + equ + MOD + MOD) % MOD << endl;
  return 0;
}
