#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long memo[100005][2][2];
char a[100005], b[100005];
int n;
long long solve(int ind, bool ok1, bool ok2) {
  if (ind == n) return (ok1 && ok2);
  long long &ret = memo[ind][ok1][ok2];
  if (ret != -1) return ret;
  ret = 0;
  if (a[ind] != '?' && b[ind] != '?')
    ret =
        solve(ind + 1, ok1 | (a[ind] < b[ind]), ok2 | (a[ind] > b[ind])) % mod;
  else if (a[ind] == '?' && b[ind] == '?') {
    for (char i = '0'; i <= '9'; ++i)
      for (char j = '0'; j <= '9'; ++j)
        ret = (ret + solve(ind + 1, ok1 | (i < j), ok2 | (i > j))) % mod;
  } else {
    for (char c = '0'; c <= '9'; ++c) {
      if (a[ind] == '?')
        ret = (ret + solve(ind + 1, ok1 | (c < b[ind]), ok2 | (c > b[ind]))) %
              mod;
      else
        ret = (ret + solve(ind + 1, ok1 | (a[ind] < c), ok2 | (a[ind] > c))) %
              mod;
    }
  }
  return ret % mod;
}
int main() {
  scanf("%d", &n);
  scanf("%s", a);
  scanf("%s", b);
  memset(memo, -1, sizeof(memo));
  printf("%d\n", int(solve(0, 0, 0) % mod));
  return 0;
}
