#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
bool big(const string &s, const string &w) {
  for (size_t i = 0; i < s.size(); ++i)
    if (s[i] != '?' && w[i] != '?' && s[i] > w[i]) return true;
  return false;
}
bool little(const string &s, const string &w) {
  for (size_t i = 0; i < s.size(); ++i)
    if (s[i] != '?' && w[i] != '?' && s[i] < w[i]) return true;
  return false;
}
long long mod_pow(long long x, long long n) {
  bitset<32> s(n);
  long long res = 1;
  for (long long i = 0; i < 32; ++i) {
    if (s[i]) res = res * x % mod;
    x = x * x % mod;
  }
  return res;
}
int numQ(const string &s) { return count(s.begin(), s.end(), '?'); }
long long numBig(const string &s, const string &w) {
  long long a = 1;
  for (size_t i = 0; i < s.size(); ++i) {
    if (s[i] == '?' && w[i] == '?')
      a = a * 55 % mod;
    else if (w[i] == '?')
      a = a * (10 - (s[i] - '0')) % mod;
    else if (s[i] == '?')
      a = a * ((w[i] - '0') + 1) % mod;
  }
  return a;
}
long long numLittle(const string &s, const string &w) {
  long long a = 1;
  for (size_t i = 0; i < s.size(); ++i) {
    if (s[i] == '?' && w[i] == '?')
      a = a * 55 % mod;
    else if (w[i] == '?')
      a = a * ((s[i] - '0') + 1) % mod;
    else if (s[i] == '?')
      a = a * (10 - (w[i] - '0')) % mod;
  }
  return a;
}
long long numSame(const string &s, const string &w) {
  long long a = 1;
  for (size_t i = 0; i < s.size(); ++i) {
    if (s[i] == '?' && w[i] == '?') a = a * 10 % mod;
  }
  return a;
}
void solve(istream &in, ostream &out) {
  int n;
  in >> n;
  if (n == 1) {
    out << 0 << endl;
    return;
  }
  string s, w;
  in >> s >> w;
  bool b = big(s, w);
  bool l = little(s, w);
  if (b && l) {
    out << mod_pow(10, numQ(s) + numQ(w)) << endl;
    return;
  }
  if (l) {
    out << (mod_pow(10, numQ(s) + numQ(w)) - numBig(s, w) + mod) % mod << endl;
    return;
  }
  if (b) {
    out << (mod_pow(10, numQ(s) + numQ(w)) - numLittle(s, w) + mod) % mod
        << endl;
    return;
  }
  out << (mod_pow(10, numQ(s) + numQ(w)) - numBig(s, w) - numLittle(s, w) +
          numSame(s, w) + mod) %
             mod
      << endl;
}
int main() {
  solve(cin, cout);
  return 0;
}
