#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int solve(string a, string b) {
  long long int ans = 1;
  for (int i = (0); i < (a.size()); i++) {
    if (a[i] != '?' && b[i] != '?') {
      if (a[i] > b[i]) return 0;
    } else if (a[i] == '?' && b[i] == '?') {
      ans = (ans * 55) % mod;
    } else if (a[i] == '?') {
      ans = (ans * (b[i] - '0' + 1)) % mod;
    } else if (b[i] == '?') {
      ans = (ans * (9 - (a[i] - '0') + 1)) % mod;
    }
  }
  return ans;
}
long long int nrq(string a, string b) {
  long long int ans = 1;
  for (int i = (0); i < (a.size()); i++)
    if (a[i] == '?') ans = (ans * 10) % mod;
  for (int i = (0); i < (b.size()); i++)
    if (b[i] == '?') ans = (ans * 10) % mod;
  return ans;
}
long long int equal(string a, string b) {
  long long int ans = 1;
  for (int i = (0); i < (a.size()); i++) {
    if (a[i] == '?' && b[i] == '?')
      ans = (ans * 10) % mod;
    else if (a[i] != '?' && b[i] != '?') {
      if (a[i] != b[i]) return 0;
    }
  }
  return ans;
}
int main() {
  {
    int n;
    cin >> n;
    string a, b;
    cin >> a >> b;
    long long int ans = solve(a, b);
    ans = (ans + solve(b, a) + mod) % mod;
    ans = (ans - equal(a, b) + mod) % mod;
    long long int q = nrq(a, b);
    cout << (q - ans + mod) % mod << endl;
  }
  return 0;
}
