#include <bits/stdc++.h>
using namespace std;
const int N = 100004, M = 12;
long long mod = 1000000007, f[N], g[N], h[N], z[N];
int us[N], ut[N], n;
char s[N], t[N];
int main() {
  scanf("%d %s %s", &n, s + 1, t + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '?')
      us[i] = 1023;
    else
      us[i] = 1 << (s[i] - '0');
    if (t[i] == '?')
      ut[i] = 1023;
    else
      ut[i] = 1 << (t[i] - '0');
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 10; j++)
      if (us[i] >> j & 1)
        for (int k = 0; k < 10; k++)
          if (ut[i] >> k & 1) {
            if (j >= k) ++f[i];
            if (j <= k) ++g[i];
            if (j == k) ++h[i];
            ++z[i];
          }
  long long s1 = 1, s2 = 1, s3 = 1, a = 1;
  for (int i = 1; i <= n; i++) {
    s1 = s1 * f[i] % mod;
    s2 = s2 * g[i] % mod;
    s3 = s3 * h[i] % mod;
    a = a * z[i] % mod;
  }
  long long ans = a - s1 - s2 + s3;
  ans = (ans % mod + mod) % mod;
  printf("%lld\n", ans);
}
