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