#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const long long m = 1e9 + 7;
struct strd {
  long long lft, rgt, sum, ans, cnt;
  bool pos;
  strd(bool _x = 0) {
    lft = rgt = sum = ans = 0;
    pos = cnt = _x;
  }
};
inline strd combine(const strd &a, const strd &b) {
  strd res;
  res.lft = a.pos ? a.lft : b.lft;
  res.rgt = b.pos ? b.rgt : a.rgt;
  res.sum = a.sum + b.sum;
  res.sum -= (res.sum >= m) * m;
  res.cnt = a.cnt + b.cnt;
  res.cnt -= (res.cnt >= m) * m;
  res.pos = a.pos | b.pos;
  res.ans = (a.ans + b.ans + a.rgt * b.lft) % m;
  return res;
}
int ch[N][2][2];
strd dp[N][2][2];
long long p[N];
int n;
string l, r;
strd solve(int pos, int uc, int lc) {
  if (pos > n) return strd(1);
  if (ch[pos][uc][lc]) return dp[pos][uc][lc];
  strd a, b;
  int ud = r[pos - 1] - '0';
  int ld = l[pos - 1] - '0';
  if ((uc || 4 <= ud) && (lc || 4 >= ld)) {
    a = solve(pos + 1, uc | (4 < ud), lc | (4 > ld));
    long long an = (4 * p[n - pos]) % m;
    long long sq = an * an % m;
    if (a.pos) {
      a.ans = (a.ans + (a.cnt - 1) * sq) % m;
      a.ans = (a.ans + (2 * a.sum - a.lft - a.rgt) * an) % m;
      a.ans += (a.ans < 0) * m;
      a.lft = (a.lft + an) % m;
      a.rgt = (a.rgt + an) % m;
      a.sum = (a.sum + an * a.cnt) % m;
    }
  }
  if ((uc || 7 <= ud) && (lc || 7 >= ld)) {
    b = solve(pos + 1, uc | (7 < ud), lc | (7 > ld));
    long long an = (7 * p[n - pos]) % m;
    long long sq = an * an % m;
    if (b.pos) {
      b.ans = (b.ans + (b.cnt - 1) * sq) % m;
      b.ans = (b.ans + (2 * b.sum - b.lft - b.rgt) * an) % m;
      b.ans += (b.ans < 0) * m;
      b.lft = (b.lft + an) % m;
      b.rgt = (b.rgt + an) % m;
      b.sum = (b.sum + an * b.cnt) % m;
    }
  }
  ch[pos][uc][lc] = 1;
  return dp[pos][uc][lc] = combine(a, b);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  cin >> l >> r;
  p[0] = 1;
  for (int i = 1; i <= (int)(N - 1); ++i) p[i] = 10 * p[i - 1] % m;
  n = l.size();
  cout << solve(1, 0, 0).ans << endl;
  return 0;
}
