#include <bits/stdc++.h>
using namespace std;
int kkaass = 1;
string A, B;
int n;
long long dp[100009][2][2];
long long rec(int ind, int l, int r) {
  if (ind == n) {
    if (l && r)
      return 1;
    else
      return 0;
  }
  long long &ret = dp[ind][l][r];
  if (ret != -1) return ret;
  ret = 0;
  int av = A[ind] - '0';
  int bv = B[ind] - '0';
  if (A[ind] == '?' && B[ind] == '?') {
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        if (i > j)
          ret = (ret + rec(ind + 1, 1, r)) % 1000000007;
        else if (i < j)
          ret = (ret + rec(ind + 1, l, 1)) % 1000000007;
        else
          ret = (ret + rec(ind + 1, l, r)) % 1000000007;
      }
    }
  } else if (A[ind] == '?') {
    for (int i = 0; i < 10; i++) {
      if (i > bv)
        ret = (ret + rec(ind + 1, 1, r)) % 1000000007;
      else if (i < bv)
        ret = (ret + rec(ind + 1, l, 1)) % 1000000007;
      else
        ret = (ret + rec(ind + 1, l, r)) % 1000000007;
    }
  } else if (B[ind] == '?') {
    for (int i = 0; i < 10; i++) {
      if (av > i)
        ret = (ret + rec(ind + 1, 1, r)) % 1000000007;
      else if (av < i)
        ret = (ret + rec(ind + 1, l, 1)) % 1000000007;
      else
        ret = (ret + rec(ind + 1, l, r)) % 1000000007;
    }
  } else {
    if (av > bv)
      ret = (ret + rec(ind + 1, 1, r)) % 1000000007;
    else if (av < bv)
      ret = (ret + rec(ind + 1, l, 1)) % 1000000007;
    else
      ret = (ret + rec(ind + 1, l, r)) % 1000000007;
  }
  return ret;
}
int main() {
  cin >> n >> A >> B;
  memset(dp, -1, sizeof(dp));
  cout << rec(0, 0, 0) << endl;
  return 0;
}
