#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
template <class T>
void add(T &a, T b) {
  (a += (b % MOD + MOD) % MOD) %= MOD;
}
int main() {
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  vector<vector<int>> dp(n + 1, vector<int>(4));
  dp[0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 4; j++) {
      for (int x = 0; x < 10; x++)
        if (s[i] == '?' || s[i] == '0' + x) {
          for (int y = 0; y < 10; y++)
            if (t[i] == '?' || t[i] == '0' + y) {
              int nj = j | (x > y) * 1 | (x < y) * 2;
              add(dp[i + 1][nj], dp[i][j]);
            }
        }
    }
  cout << dp[n][3] << endl;
  return 0;
}
