#include <bits/stdc++.h>
using namespace std;
int main() {
  char s1[100004];
  char s2[100004];
  long long int l, n, i, j;
  scanf("%lld", &n);
  scanf("%s", s1);
  scanf("%s", s2);
  i = 0;
  long long int ans = 1, x = 1, y = 1, z = 1;
  for (i = 0; i < n; i++) {
    if (s1[i] == '?' && s2[i] == '?') {
      ans = ans * 100 % 1000000007;
      x = x * 55 % 1000000007;
      y = y * 55 % 1000000007;
      z = z * 10 % 1000000007;
    } else if (s1[i] == '?' && s2[i] != '?') {
      int k = s2[i] - '0';
      x = (x * (k + 1)) % 1000000007;
      y = (y * (10 - k)) % 1000000007;
      ans = ans * 10 % 1000000007;
      z = z * 1 % 1000000007;
    } else if (s2[i] == '?' && s1[i] != '?') {
      int k = s1[i] - '0';
      x = (x * (10 - k)) % 1000000007;
      y = (y * (k + 1)) % 1000000007;
      ans = ans * 10 % 1000000007;
      z = z * 1 % 1000000007;
    } else {
      if (s1[i] < s2[i]) {
        y = 0;
        z = 0;
      }
      if (s1[i] > s2[i]) {
        x = 0;
        z = 0;
      }
    }
  }
  ans = ans - x - y + z;
  cout << (ans + 1000000007) % 1000000007 << endl;
  return 0;
}
