#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;
char s1[100001];
char s2[100001];
int dp[100000][4];
int n;
int go(int o, int st) {
  if (o == n) return st == 3;
  if (dp[o][st] != -1) return dp[o][st];
  int i, j, ii, jj;
  if (s1[o] == '?')
    i = 0, j = 9;
  else
    i = j = s1[o];
  if (s2[o] == '?')
    ii = 0, jj = 9;
  else
    ii = jj = s2[o];
  long long sum = 0;
  for (int a = i; a <= j; a++)
    for (int b = ii; b <= jj; b++) {
      if (a > b)
        sum += go(o + 1, st | 1);
      else if (a < b)
        sum += go(o + 1, st | 2);
      else
        sum += go(o + 1, st);
    }
  return dp[o][st] = sum % MOD;
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%d", &n);
  scanf("%s", s1);
  scanf("%s", s2);
  for (int i = 0; i < n; i++) {
    if (s1[i] != '?') s1[i] -= '0';
    if (s2[i] != '?') s2[i] -= '0';
  }
  printf("%d", go(0, 0));
}
