#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("avx,avx2,fma")
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
long long fermat_inv(long long y) { return power(y, 1000000007 - 2); }
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
const long long N = 1e5 + 5;
long long dp[N][2][2];
long long n;
string s1, s2;
long long foo(long long i, long long f1, long long f2) {
  if (i == n) return (f1 & f2);
  long long &ans = dp[i][f1][f2];
  if (ans != -1) return ans;
  ans = 0;
  if (s1[i] == '?' && s2[i] == '?') {
    ans += (foo(i + 1, f1, 1LL) * 45LL);
    ans += (foo(i + 1, 1LL, f2) * 45LL);
    ans += (foo(i + 1, f1, f2) * 10LL);
    ans %= 1000000007;
  } else if (s1[i] == '?') {
    long long val = s2[i] - '0';
    ans += (foo(i + 1, f1, 1LL) * val);
    ans += (foo(i + 1, 1LL, f2) * (9LL - val));
    ans += (foo(i + 1, f1, f2));
    ans %= 1000000007;
  } else if (s2[i] == '?') {
    long long val = s1[i] - '0';
    ans += (foo(i + 1, 1LL, f2) * val);
    ans += (foo(i + 1, f1, 1LL) * (9LL - val));
    ans += (foo(i + 1, f1, f2));
    ans %= 1000000007;
  } else {
    f1 |= (s1[i] > s2[i]);
    f2 |= (s2[i] > s1[i]);
    ans += (foo(i + 1, f1, f2));
    ans %= 1000000007;
  }
  return ans;
}
void solve() {
  memset(dp, -1, sizeof(dp));
  cin >> n;
  cin >> s1 >> s2;
  cout << foo(0, 0, 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
