#include <bits/stdc++.h>
using namespace std;
long long v1 = 1000000007, ans = 1;
int vis[1000], len = 0;
vector<int> ed[1000];
long long cal(char c1, char c2, int f1, int f2) {
  long long i, j, k, m = 0, k1;
  if (f1 == 1 && f2 == 1) return 0;
  i = (c1 == '?') ? 9 : int(c1) - 48;
  j = (c2 == '?') ? 0 : int(c2) - 48;
  k = i - j + 1;
  if (c1 == '?' && c2 == '?') k = ((k * (k + 1)) / 2) % v1;
  if (f1 == 1) return k;
  m = k;
  i = (c1 == '?') ? 0 : int(c1) - 48;
  j = (c2 == '?') ? 9 : int(c2) - 48;
  k = j - i + 1;
  if (c1 == '?' && c2 == '?') k = ((k * (k + 1)) / 2) % v1;
  if (f2 == 1) return k;
  ans = (ans * m) % v1;
  return k;
}
int main() {
  long long i, j, k = 0, n, m, a[1002], f[2];
  cin >> n;
  f[0] = f[1] = 0;
  string s1, s2;
  cin >> s1 >> s2;
  for (i = 0; i < n; i++) {
    if (s1[i] != '?' && s2[i] != '?') {
      if (s1[i] > s2[i]) f[0] = 1;
      if (s1[i] < s2[i]) f[1] = 1;
    } else
      k = 1;
  }
  m = 0;
  if (k == 0) {
    m = (f[0] && f[1]);
    cout << m << endl;
    return 0;
  }
  for (i = 0; i < n; i++) {
    m = m + (s1[i] == '?') + (s2[i] == '?');
    if (s1[i] == '?' || s2[i] == '?')
      k = (k * cal(s1[i], s2[i], f[0], f[1])) % v1;
  }
  i = m;
  m = 1;
  for (; i > 0; i--) m = (m * 10) % v1;
  m = m - k - ans;
  if (m < 0) m = m + v1;
  if (m < 0) m = m + v1;
  k = 1;
  if (ans > 1) {
    for (i = 0; i < n; i++)
      if (s1[i] == '?' && s2[i] == '?') k = (k * 10) % v1;
  }
  m = (m + k) % v1;
  cout << m << endl;
  return 0;
}
