#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long add(long long a, long long b) {
  if (b < 0) b += mod;
  a += b;
  if (a > mod) a -= mod;
  return a;
}
long long mul(long long a, long long b) { return a * b % mod; }
long long cal(char s[]) {
  long long F[2] = {0}, K[2] = {1}, S[2] = {0}, T[2] = {0}, AK[2] = {0},
            A1[2] = {0};
  int cur = 0, nxt = 0;
  for (int i = 0; s[i]; i++, cur = nxt) {
    nxt = cur ^ 1;
    F[nxt] = add(mul(F[cur], 100), mul(56, K[cur] - 1));
    F[nxt] = add(F[nxt], mul(S[cur], 220));
    F[nxt] = add(F[nxt], mul(100, T[cur]));
    F[nxt] = add(F[nxt], mul(70, AK[cur] - A1[cur]));
    S[nxt] = add(mul(K[cur] - 1, 11), mul(S[cur], 20));
    T[nxt] = add(add(mul(T[cur], 200), mul(S[cur], 220)), mul(K[cur] - 1, 65));
    AK[nxt] = add(mul(AK[cur], 10), s[i] - '0');
    A1[nxt] = add(mul(A1[cur], 10), 4);
    K[nxt] = mul(K[cur], 2);
    if (s[i] == '7') {
      long long t = mul(AK[cur], 10);
      F[nxt] = add(F[nxt], mul(t + 4, t + 7));
      S[nxt] = add(S[nxt], t + 4);
      T[nxt] = add(T[nxt], mul(t + 4, t + 4));
    } else
      K[nxt] = add(K[nxt], -1);
  }
  return F[nxt];
}
int main() {
  char s[100010], t[100010];
  cin >> s >> t;
  cout << (cal(t) - cal(s) + mod) % mod << endl;
  return 0;
}
