#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const double eps = 1e-9;
const int nm = 100005;
int n, k, m;
long long res, res1, res2, res3;
int Hoi1, Hoi2;
int a[nm];
char s[nm], t[nm];
bool check[nm];
long long Pow(int x, int mu) {
  if (mu == 0) return 1ll;
  long long res = Pow(x, mu >> 1);
  res = res * res % MOD;
  if (mu & 1) res = res * x % MOD;
  return res;
}
int main() {
  int i, j, x, y, z, w;
  bool Nho = 0, Lon = 0;
  scanf("%d", &n);
  scanf("%s", &s);
  scanf("%s", &t);
  for (i = 0; i < n; i++) {
    if (s[i] != '?' && t[i] != '?') {
      if (s[i] < t[i])
        Nho = 1;
      else if (s[i] > t[i])
        Lon = 1;
    }
    if (s[i] == '?') Hoi1++;
    if (t[i] == '?') Hoi2++;
  }
  if (Nho && Lon) {
    cout << Pow(10, Hoi1 + Hoi2);
    return 0;
  }
  if (!Lon) {
    res1 = 1;
    for (i = 0; i < n; i++)
      if (s[i] == '?' || t[i] == '?') {
        if (s[i] == '?' && t[i] == '?')
          res1 = res1 * 55 % MOD;
        else if (s[i] == '?') {
          res1 = res1 * (t[i] - 47) % MOD;
        } else {
          res1 = res1 * (10 - (s[i] - 48)) % MOD;
        }
      }
  }
  if (!Nho) {
    res2 = 1;
    for (i = 0; i < n; i++)
      if (s[i] == '?' || t[i] == '?') {
        if (s[i] == '?' && t[i] == '?')
          res2 = res2 * 55 % MOD;
        else if (s[i] == '?') {
          res2 = res2 * (10 - (t[i] - 48)) % MOD;
        } else {
          res2 = res2 * (s[i] - 47) % MOD;
        }
      }
  }
  if (!Nho && !Lon) {
    for (i = 0; i < n; i++)
      if (s[i] == '?' && t[i] == '?') {
        if (res3 == 0) res3 = 1;
        res3 = res3 * 10 % MOD;
      }
  }
  res = Pow(10, Hoi1 + Hoi2);
  cout << (res - res1 - res2 + res3 + MOD + MOD) % MOD;
  return 0;
}
