#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s1, s2;
  cin >> s1;
  cin >> s2;
  int M = 1000000007;
  long long all = 1;
  long long down = 1, up = 1, eq = 1;
  for (int i = 0; i < n; i++) {
    if (s1[i] == '?' && s2[i] == '?') {
      eq *= 10LL;
      up *= 55LL;
      down *= 55LL;
      all *= 100LL;
    }
    if (s1[i] == '?' && s2[i] != '?') {
      up *= (long long)('9' - s2[i] + 1);
      down *= (long long)(s2[i] - '0' + 1);
      all *= 10LL;
    }
    if (s1[i] != '?' && s2[i] == '?') {
      up *= (long long)(s1[i] - '0' + 1);
      down *= (long long)('9' - s1[i] + 1);
      all *= 10LL;
    }
    if (s1[i] != '?' && s2[i] != '?') {
      if (s1[i] > s2[i]) down = 0;
      if (s1[i] < s2[i]) up = 0;
      if (s1[i] != s2[i]) eq = 0;
    }
    up %= M;
    down %= M;
    eq %= M;
    all %= M;
  }
  all = (((all - up + M) % M - down + M) % M + eq + M) % M;
  cout << all;
}
