#include <bits/stdc++.h>
using namespace std;
constexpr int md = (int)1e9 + 7;
inline int add(int a, int b) {
  a += b;
  if (a >= md) a -= md;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += md;
  return a;
}
inline int mul(int a, int b) { return (int)((long long)a * b % md); }
inline int powmod(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
inline int inv(int a) {
  a %= md;
  if (a < 0) a += md;
  int b = md, u = 0, v = 1;
  while (a) {
    int t = b / a;
    b -= t * a;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  string a, b;
  cin >> a >> b;
  int res = 1;
  bool small = false;
  bool big = false;
  for (int i = 0; i < n; i++) {
    if (a[i] != '?' && b[i] != '?') {
      int pa = a[i] - '0';
      int pb = b[i] - '0';
      if (pa > pb) {
        big = true;
      } else if (pa < pb) {
        small = true;
      }
    }
  }
  int tot = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == '?') {
      tot = mul(tot, 10);
    }
    if (b[i] == '?') {
      tot = mul(tot, 10);
    }
  }
  if (big && small) {
    res = 0;
  } else if (big) {
    for (int i = 0; i < n; i++) {
      if (a[i] == '?' && b[i] == '?') {
        res = mul(res, 55);
      } else if (a[i] == '?') {
        res = mul(res, 10 - (b[i] - '0'));
      } else if (b[i] == '?') {
        res = mul(res, a[i] - '0' + 1);
      }
    }
  } else if (small) {
    for (int i = 0; i < n; i++) {
      if (a[i] == '?' && b[i] == '?') {
        res = mul(res, 55);
      } else if (a[i] == '?') {
        res = mul(res, b[i] - '0' + 1);
      } else if (b[i] == '?') {
        res = mul(res, 10 - (a[i] - '0'));
      }
    }
  } else {
    int pa = 1, pb = 1, pc = 1;
    for (int i = 0; i < n; i++) {
      if (a[i] == '?' && b[i] == '?') {
        pa = mul(pa, 55);
      } else if (a[i] == '?') {
        pa = mul(pa, 10 - (b[i] - '0'));
      } else if (b[i] == '?') {
        pa = mul(pa, a[i] - '0' + 1);
      }
    }
    for (int i = 0; i < n; i++) {
      if (a[i] == '?' && b[i] == '?') {
        pb = mul(pb, 55);
      } else if (a[i] == '?') {
        pb = mul(pb, b[i] - '0' + 1);
      } else if (b[i] == '?') {
        pb = mul(pb, 10 - (a[i] - '0'));
      }
    }
    for (int i = 0; i < n; i++) {
      if (a[i] == '?' && b[i] == '?') {
        pc = mul(pc, 10);
      }
    }
    res = sub(add(pa, pb), pc);
  }
  res = sub(tot, res);
  cout << res;
  return 0;
}
