#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, flag = 0, a, b;
  cin >> n;
  string s1, s2;
  cin >> s1 >> s2;
  int que = 0, low = 0, hi = 0;
  for (int i = 0; i < n; i++) {
    if (s1[i] == '?') que++;
    if (s2[i] == '?') que++;
    if (s1[i] != '?' && s2[i] != '?') {
      if ((s1[i] - '0') < (s2[i] - '0'))
        low = 1;
      else if ((s1[i] - '0') > (s2[i] - '0'))
        hi = 1;
    }
  }
  if ((hi == 0 || low == 0) && que == 0) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 1;
  for (int i = 0; i < que; i++) {
    ans = (ans * 10) % 1000000007;
  }
  if (hi == 1 && low == 1) {
    cout << ans << endl;
    return 0;
  }
  if (hi == 1 || low == 1) {
    long long temp = 1;
    for (int i = 0; i < n; i++) {
      if (s1[i] == '?' && s2[i] == '?') {
        temp = (temp * 55) % 1000000007;
      } else if (s1[i] != '?' && s2[i] == '?') {
        int r = s1[i] - '0';
        if (low == 1) {
          temp = (temp * (9 - r + 1)) % 1000000007;
        } else {
          temp = (temp * (r + 1)) % 1000000007;
        }
      } else if (s2[i] != '?' && s1[i] == '?') {
        int r = s2[i] - '0';
        if (hi == 1) {
          temp = (temp * (9 - r + 1)) % 1000000007;
        } else {
          temp = (temp * (r + 1)) % 1000000007;
        }
      }
    }
    cout << (ans - temp + 1000000007) % 1000000007;
    return 0;
  } else {
    long long temp1 = 1, temp2 = 1, temp3 = 1;
    for (int i = 0; i < n; i++) {
      if (s1[i] == '?' && s2[i] == '?') temp3 = (temp3 * 10) % 1000000007;
      if (s1[i] == '?' && s2[i] == '?') {
        temp1 = (temp1 * 55) % 1000000007;
        temp2 = (temp2 * 55) % 1000000007;
      } else if (s2[i] != '?' && s1[i] == '?') {
        int r = s2[i] - '0';
        temp1 = (temp1 * (9 - r + 1)) % 1000000007;
        temp2 = (temp2 * (r + 1)) % 1000000007;
      } else if (s2[i] == '?' && s1[i] != '?') {
        int r = s1[i] - '0';
        temp2 = (temp2 * (9 - r + 1)) % 1000000007;
        temp1 = (temp1 * (r + 1)) % 1000000007;
      }
    }
    ans = (ans - temp1 - temp2 + temp3 + 1000000007) % 1000000007;
    cout << ans << endl;
    return 0;
  }
  return 0;
}
