#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
const int mod2 = 1e9 + 9;
long long int N, M, dn[maxn][2][2], p[maxn], p2[maxn], h[maxn], h2[maxn],
    n[maxn], hhash, hash2;
string s, t;
long long int f(int a, int ever, int last) {
  if (a > N) return ever;
  if (dn[a][ever][last] != -1) return dn[a][ever][last];
  long long int ret = 0;
  if (n[a] <= N) ret += f(n[a] + 1, 1, 1), ret %= mod;
  if (last) ret += f(a + 1, ever, 1), ret %= mod;
  ret += f(a + 1, ever, 0), ret %= mod;
  return dn[a][ever][last] = ret;
}
int main() {
  cin >> s >> t;
  N = s.size();
  M = t.size();
  s = '#' + s;
  t = '#' + t;
  p[0] = p2[0] = 1ll;
  for (int i = 1; i <= N; i++) p[i] = p[i - 1] * 37ll, p[i] %= mod;
  for (int i = 1; i <= N; i++) p2[i] = p2[i - 1] * 41ll, p2[i] %= mod2;
  for (int i = 1; i <= N; i++)
    h[i] = h[i - 1] + p[i] * (s[i] - 'a'), h[i] %= mod;
  for (int i = 1; i <= N; i++)
    h2[i] = h2[i - 1] + p2[i] * (s[i] - 'a'), h2[i] %= mod2;
  for (int i = 1; i <= M; i++) hhash += p[i] * (t[i] - 'a'), hhash %= mod;
  for (int i = 1; i <= M; i++) hash2 += p2[i] * (t[i] - 'a'), hash2 %= mod2;
  for (int i = 1; i <= N; i++) {
    if (i + M - 1 <= N &&
        (h[i + M - 1] - h[i - 1] + mod) % mod == (hhash * p[i - 1]) % mod &&
        (h2[i + M - 1] - h2[i - 1] + mod2) % mod2 == (hash2 * p2[i - 1]) % mod2)
      n[i] = i + M - 1;
    else
      n[i] = N + 1;
  }
  n[N + 1] = N + 1;
  for (int i = N; i > 0; i--) (n[i]) = min((n[i]), (n[i + 1]));
  memset((dn), (-1), sizeof(dn));
  cout << f(1, 0, 0) << '\n';
  return 0;
}
