#include <bits/stdc++.h>
using namespace std;
template <class T>
typename T::value_type arr_sum(const T &v, int n) {
  typename T::value_type sum = 0;
  for (int i = (0); i < (n); ++i) sum += v[i];
  return sum;
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
void mul(long long &a, long long b) { a = (a * b) % 1000000007; }
void minus1(long long &a, long long b) {
  a = (a - b);
  if (a < 0) {
    a += 1000000007;
  }
  a = a % 1000000007;
}
void plus1(long long &a, long long b) { a = (a + b) % 1000000007; }
int main() {
  int n;
  cin >> n;
  string s1;
  string s2;
  cin >> s1 >> s2;
  long long res = 1;
  long long res2 = 1;
  long long res3 = 1;
  for (int i = (0); i < (n); ++i) {
    if (s1[i] == '?' && s2[i] == '?') {
      mul(res, 55);
      mul(res2, 55);
      mul(res3, 10);
    } else if (s1[i] == '?') {
      mul(res, s2[i] - '0' + 1);
      mul(res2, '9' - s2[i] + 1);
    } else if (s2[i] == '?') {
      mul(res2, s1[i] - '0' + 1);
      mul(res, '9' - s1[i] + 1);
    } else {
      mul(res, s1[i] <= s2[i]);
      mul(res2, s1[i] >= s2[i]);
      mul(res3, s1[i] == s2[i]);
    }
  }
  long long ans = 1;
  long long c =
      count(s1.begin(), s1.end(), '?') + count(s2.begin(), s2.end(), '?');
  for (int i = (0); i < (c); ++i) {
    mul(ans, 10);
  }
  minus1(ans, res);
  minus1(ans, res2);
  plus1(ans, res3);
  cout << ans;
}
