#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000007;
string s, t;
long long l = 1, n, i, j, ans = 1, e, d, x, y, a, b;
long long power(long long a, long long b) {
  if (b < 0) return 0;
  if (b == 0) return 1;
  if (b == 1) return (a % inf);
  if (b & 1) {
    return ((a * power(a, b - 1)) % inf + inf) % inf;
  } else
    return ((power(a, b / 2) * power(a, b / 2)) % inf + inf) % inf;
}
int main() {
  cin >> n;
  cin >> s >> t;
  for (i = 0; i < n; i++) {
    if (s[i] == '?') a++;
    if (t[i] == '?') b++;
    if (s[i] != '?' && t[i] != '?') {
      if (s[i] > t[i]) x = 1;
      if (s[i] < t[i]) y = 1;
    }
  }
  if (x == 1 && y == 1) {
    d = power(10, a + b);
    cout << d;
    return 0;
  }
  if (x == 1) {
    for (i = 0; i < n; i++) {
      if (s[i] == '?' && t[i] == '?')
        ans = ((ans * 55) % inf + inf) % inf;
      else {
        if (s[i] == '?') {
          e = 10 - (t[i] - '0');
          ans = ((ans * e) % inf + inf) % inf;
        } else {
          if (t[i] == '?') {
            ans = ((ans * (s[i] - '0' + 1)) % inf + inf) % inf;
          }
        }
      }
    }
  }
  if (y == 1) {
    for (i = 0; i < n; i++) {
      if (s[i] == '?' && t[i] == '?')
        ans = ((ans * 55) % inf + inf) % inf;
      else {
        if (s[i] == '?') {
          ans = ((ans * (t[i] - '0' + 1)) % inf + inf) % inf;
        } else {
          if (t[i] == '?') {
            e = 10 - (s[i] - '0');
            ans = ((ans * e) % inf + inf) % inf;
          }
        }
      }
    }
  }
  if (x == 0 && y == 0) {
    e = 1;
    for (i = 0; i < n; i++) {
      if (s[i] == '?' && t[i] == '?') {
        e = ((e * 55) % inf + inf) % inf;
        ans = ((ans * 55) % inf + inf) % inf;
        l = ((l * 10) % inf + inf) % inf;
      } else {
        if (s[i] == '?') {
          e = (e * (t[i] - '0' + 1) % inf + inf) % inf;
          ans = ((ans * (10 - (t[i] - '0'))) % inf + inf) % inf;
        } else {
          if (t[i] == '?') {
            e = ((e * (10 - (s[i] - '0'))) % inf + inf) % inf;
            ans = ((ans * ((s[i] - '0') + 1)) % inf + inf) % inf;
          }
        }
      }
    }
    ans = ((ans + e - l) % inf + inf) % inf;
  }
  e = ((power(10, a + b) - ans) % inf + inf) % inf;
  cout << e;
  return 0;
}
