#include <bits/stdc++.h>
const int mo = 1e9 + 7, N = 1e5 + 1;
using namespace std;
int n, m, i, j, last, fail[N], p[N], f[N], sum[N], SUM[N];
char s1[N], s2[N];
int main() {
  gets(s1);
  gets(s2);
  n = strlen(s1);
  m = strlen(s2);
  for (i = n; i; i--) s1[i] = s1[i - 1];
  for (i = m; i; i--) s2[i] = s2[i - 1];
  for (i = 2, j = 0; i <= m; i++) {
    for (; j && s2[j + 1] != s2[i]; j = fail[j])
      ;
    if (s2[j + 1] == s2[i]) j++;
    fail[i] = j;
  }
  for (i = sum[0] = SUM[0] = 1, j = 0; i <= n; i++) {
    for (; j && s2[j + 1] != s1[i]; j = fail[j])
      ;
    if (s2[j + 1] == s1[i]) j++;
    if (j == m) {
      p[i] = i - m + 1;
      j = fail[j];
      last = i;
    } else
      p[i] = last - m + 1;
    if (p[i] >= 0) f[i] = SUM[p[i] - 1];
    sum[i] = (sum[i - 1] + f[i]) % mo;
    SUM[i] = (SUM[i - 1] + sum[i]) % mo;
  }
  printf("%d", (sum[n] - 1 + mo) % mo);
}
