#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
string a, b;
long long K = 55;
int main() {
  int n;
  while (cin >> n) {
    cin >> a >> b;
    bool abtb = false, bbta = false;
    long long A = 1;
    long long B = 1;
    long long C = 1;
    long long total = 1;
    bool had = false;
    for (int i = 0; i < n; ++i) {
      if (a[i] != '?' && b[i] != '?') {
        if (a[i] > b[i]) abtb = true;
        if (b[i] > a[i]) bbta = true;
      }
      had = true;
      if (a[i] != '?' && b[i] == '?') {
        A = (A * (a[i] - '0' + 1)) % MOD;
        B = (B * ('9' - a[i] + 1)) % MOD;
        total = (total * 10) % MOD;
      }
      if (a[i] == '?' && b[i] != '?') {
        A = (A * ('9' - b[i] + 1)) % MOD;
        B = (B * (b[i] - '0' + 1)) % MOD;
        total = (total * 10) % MOD;
      }
      if (a[i] == '?' && b[i] == '?') {
        A = (A * K) % MOD;
        B = (B * K) % MOD;
        C = (C * 10) % MOD;
        total = (total * 100) % MOD;
      }
    }
    if (had == false) {
      if (abtb == true && bbta == true)
        cout << "1" << endl;
      else
        cout << "0" << endl;
      continue;
    }
    if (abtb == true && bbta == true)
      cout << total << endl;
    else if (abtb == true && bbta == false)
      cout << ((total - A + MOD) % MOD) << endl;
    else if (abtb == false && bbta == true)
      cout << ((total - B + MOD) % MOD) << endl;
    else
      cout << ((total - A - B + C + MOD + MOD) % MOD) << endl;
  }
  return 0;
}
