#include <bits/stdc++.h>
using namespace std;
string a, b;
const int mod = 1e9 + 7, N = 1e5 + 7;
int dp[N][2][2];
int f(int idx, int x, int y) {
  if (idx < 0) return x * y;
  if (~dp[idx][x][y]) return dp[idx][x][y];
  int l1 = a[idx] != '?' ? a[idx] - '0' : 0,
      r1 = a[idx] != '?' ? a[idx] - '0' : 9;
  int l2 = b[idx] != '?' ? b[idx] - '0' : 0,
      r2 = b[idx] != '?' ? b[idx] - '0' : 9;
  int res = 0;
  for (int i = l1; i <= r1; i++) {
    for (int j = l2; j <= r2; j++) {
      res += f(idx - 1, x | (i < j), y | (i > j));
      res %= mod;
    }
  }
  return dp[idx][x][y] = res;
}
int main() {
  int n;
  cin >> n >> a >> b;
  memset(dp, -1, sizeof dp);
  cout << f(n - 1, 0, 0) << endl;
}
