#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 100005;
int dp[N][4];
string a, b;
int main() {
  int n;
  while (cin >> n) {
    cin >> a >> b;
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    for (int i = 0; i < n; ++i) {
      for (int u = ((a[i] == '?') ? 0 : a[i] - '0');
           u <= ((a[i] == '?') ? 9 : a[i] - '0'); ++u) {
        for (int d = ((b[i] == '?') ? 0 : b[i] - '0');
             d <= ((b[i] == '?') ? 9 : b[i] - '0'); ++d) {
          if (u == d) {
            dp[i + 1][0] = (dp[i + 1][0] + dp[i][0]) % MOD;
            dp[i + 1][1] = (dp[i + 1][1] + dp[i][1]) % MOD;
            dp[i + 1][2] = (dp[i + 1][2] + dp[i][2]) % MOD;
            dp[i + 1][3] = (dp[i + 1][3] + dp[i][3]) % MOD;
          }
          if (u > d) {
            dp[i + 1][1] = (dp[i + 1][1] + dp[i][0]) % MOD;
            dp[i + 1][1] = (dp[i + 1][1] + dp[i][1]) % MOD;
            dp[i + 1][3] = (dp[i + 1][3] + dp[i][2]) % MOD;
            dp[i + 1][3] = (dp[i + 1][3] + dp[i][3]) % MOD;
          }
          if (u < d) {
            dp[i + 1][2] = (dp[i + 1][2] + dp[i][0]) % MOD;
            dp[i + 1][3] = (dp[i + 1][3] + dp[i][1]) % MOD;
            dp[i + 1][2] = (dp[i + 1][2] + dp[i][2]) % MOD;
            dp[i + 1][3] = (dp[i + 1][3] + dp[i][3]) % MOD;
          }
        }
      }
    }
    cout << dp[n][3] << endl;
  }
  return 0;
}
