#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007, N = 100005;
int n;
char s1[N], s2[N];
long long a[4], b[4];
int main() {
  cin >> n;
  cin >> s1 >> s2;
  memset(a, 0, sizeof(a));
  a[0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) b[j] = a[j];
    memset(a, 0, sizeof(a));
    for (int x = 0; x <= 9; x++) {
      if (s1[i] != '?' && s1[i] != '0' + x) continue;
      for (int y = 0; y <= 9; y++) {
        if (s2[i] != '?' && s2[i] != '0' + y) continue;
        if (x == y) {
          a[0] += b[0];
          a[1] += b[1];
          a[2] += b[2];
          a[3] += b[3];
        } else if (x > y) {
          a[1] += b[0];
          a[1] += b[1];
          a[3] += b[2];
          a[3] += b[3];
        } else {
          a[2] += b[0];
          a[2] += b[2];
          a[3] += b[1];
          a[3] += b[3];
        }
        for (int k = 0; k < 4; k++) a[k] %= mod;
      }
    }
  }
  cout << a[3] << endl;
}
