#include <bits/stdc++.h>
using namespace std;
string s, w;
int n;
long long rez;
int main() {
  cin >> n >> s >> w;
  rez = 1;
  for (int i = 0; i < n; i++) {
    if (s[i] == '?') rez *= 10LL;
    if (w[i] == '?') rez *= 10LL;
    rez %= 1000000007LL;
  }
  long long rez1 = 1, rez2 = 1;
  for (int i = 0; i < n; i++) {
    if ((s[i] != '?') && (w[i] != '?')) {
      if (s[i] > w[i]) rez1 = 0;
      if (s[i] < w[i]) rez2 = 0;
    }
    if ((s[i] == '?') && (w[i] == '?')) {
      rez1 *= 55LL;
      rez2 *= 55LL;
    }
    if ((s[i] == '?') && (w[i] != '?')) {
      rez1 *= (w[i] - '0') + 1LL;
      rez2 *= ('9' - w[i]) + 1LL;
    }
    if ((s[i] != '?') && (w[i] == '?')) {
      rez2 *= (s[i] - '0') + 1LL;
      rez1 *= ('9' - s[i]) + 1LL;
    }
    rez1 %= 1000000007LL;
    rez2 %= 1000000007LL;
  }
  long long rez3 = 1;
  for (int i = 0; i < n; i++) {
    if ((s[i] != '?') && (w[i] != '?')) rez3 *= (s[i] == w[i]);
    if ((s[i] == '?') && (w[i] == '?')) rez3 *= 10;
    rez3 %= 1000000007LL;
  }
  rez -= rez1;
  rez -= rez2;
  rez += rez3;
  cout << ((rez) % 1000000007LL + 1000000007LL) % 1000000007LL << endl;
  return 0;
}
