#include <bits/stdc++.h>
using namespace std;
bool canBeMadeIncomparable(string& s1, string& s2) {
  bool s1Larger = s1[0] > s2[0];
  for (int i = 1; i < s1.size(); i++) {
    if (s1Larger && s1[i] < s2[i]) {
    }
  }
}
bool areIncomparable(string& s1, string& s2) {
  bool s1Larger = s1[0] > s2[0];
  bool s2Larger = s1[0] < s2[0];
  for (int i = 1; i < s1.size(); i++) {
    if (s1[i] == '?' || s2[i] == '?') continue;
    if (s1Larger && s1[i] < s2[i]) return true;
    if (s2Larger && s2[i] < s1[i]) return true;
    if (!s1Larger && !s2Larger) {
      s1Larger = s1[i] > s2[i];
      s2Larger = s1[i] < s2[i];
    }
  }
  return false;
}
long long brute(string& s1, string& s2) {
  long long res = 0;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == '?') {
      for (int j = '0'; j <= '9'; j++) {
        s1[i] = j;
        res += brute(s1, s2);
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s1;
  string s2;
  cin >> s1 >> s2;
  vector<long long> states(4);
  if (s1[0] == '?' && s2[0] == '?') {
    states[0] += 10;
    states[1] += 45;
    states[2] += 45;
  } else if (s1[0] == '?' && s2[0] != '?') {
    states[0] += 1;
    states[1] += '9' - s2[0];
    states[2] += s2[0] - '0';
  } else if (s1[0] != '?' && s2[0] == '?') {
    states[0] += 1;
    states[1] += s1[0] - '0';
    states[2] += '9' - s1[0];
  } else if (s1[0] > s2[0]) {
    states[1]++;
  } else if (s1[0] < s2[0]) {
    states[2]++;
  } else {
    states[0]++;
  }
  const long long MOD = 1e9 + 7;
  for (int i = 1; i < s1.size(); i++) {
    if (s1[i] == '?' && s2[i] == '?') {
      states[3] = states[3] * 100 + states[2] * 45 + states[1] * 45;
      states[1] = states[0] * 45 + states[1] * 55;
      states[2] = states[0] * 45 + states[2] * 55;
      states[0] *= 10;
    } else if (s1[i] == '?' && s2[i] != '?') {
      int s1mult = '9' - s2[i];
      int s2mult = s2[i] - '0';
      states[3] = 10 * states[3] + s1mult * states[2] + s2mult * states[1];
      states[1] *= s1mult + 1;
      states[1] += states[0] * s1mult;
      states[2] *= s2mult + 1;
      states[2] += states[0] * s2mult;
    } else if (s1[i] != '?' && s2[i] == '?') {
      int s1mult = s1[i] - '0';
      int s2mult = '9' - s1[i];
      states[3] = 10 * states[3] + s1mult * states[2] + s2mult * states[1];
      states[1] *= s1mult + 1;
      states[1] += states[0] * s1mult;
      states[2] *= s2mult + 1;
      states[2] += states[0] * s2mult;
    } else if (s1[i] > s2[i]) {
      states[1] += states[0];
      states[3] += states[2];
      states[0] = 0;
      states[2] = 0;
    } else if (s1[i] < s2[i]) {
      states[3] += states[1];
      states[2] += states[0];
      states[0] = 0;
      states[1] = 0;
    }
    for (int j = 0; j < states.size(); j++) {
      states[j] = states[j] % MOD;
    }
  }
  cout << states[3] << endl;
}
