#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void smn(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
inline void smx(T &a, const T &b) {
  if (b > a) a = b;
}
template <class T>
inline T _rev(const T &a) {
  T _ = a;
  reverse(_.begin(), _.end());
  return _;
}
const double eps = 1e-8;
const long double leps = 1e-14;
const int MN = 1000 * 100 + 1000, MOD = 1000 * 1000 * 1000 + 7;
string a, b;
int d[MN][4];
int n;
int fll(int a, int b) {
  int &res = d[a][b];
  if (res != -1) return res;
  res = 0;
  if (a >= n) {
    if (b == 3) return res = 1;
    return res;
  }
  for (int i = 0; i < 10; i++)
    if (::a[a] - '0' == i || ::a[a] == '?')
      for (int j = 0; j < 10; j++)
        if (::b[a] - '0' == j || ::b[a] == '?') {
          if (i == j)
            res += fll(a + 1, b);
          else if (i > j)
            res += fll(a + 1, b | 1);
          else
            res += fll(a + 1, b | 2);
          if (res >= MOD) res -= MOD;
        }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> a >> b;
  memset(d, -1, sizeof(d));
  cout << fll(0, 0) << '\n';
  return 0;
}
