#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string a, b;
  cin >> n;
  cin >> a >> b;
  long long ub = 1;
  long long eq = 1;
  for (int i = 0; i < n; i++)
    if (a[i] == '?' && b[i] == '?') {
      ub = (ub * 55) % 1000000007;
      eq = (eq * 10) % 1000000007;
    } else if (a[i] == '?')
      ub = (ub * (10 - b[i] + '0')) % 1000000007;
    else if (b[i] == '?')
      ub = (ub * (a[i] - '0' + 1)) % 1000000007;
    else if (a[i] < b[i]) {
      ub = 0;
      eq = 0;
    }
  long long lb = 1;
  for (int i = 0; i < n; i++)
    if (a[i] == '?' && b[i] == '?') {
      lb = (lb * 55) % 1000000007;
    } else if (a[i] == '?')
      lb = (lb * (b[i] - '0' + 1)) % 1000000007;
    else if (b[i] == '?')
      lb = (lb * (10 - a[i] + '0')) % 1000000007;
    else if (a[i] > b[i]) {
      lb = 0;
      eq = 0;
    }
  int cn = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == '?') cn++;
    if (b[i] == '?') cn++;
  }
  long long poss = 1;
  for (int i = 1; i <= cn; i++) poss = (poss * 10) % 1000000007;
  cout << (poss - lb - ub + 1000000007 + 1000000007 + 1000000007 + eq) %
              1000000007
       << endl;
  return 0;
}
