#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int mod = 1e9 + 7;
char s[N], t[N];
int n, m, p[N], a[N], lst[N], pre[N], g[N], dp[N], ans = 0;
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
int main() {
  scanf("%s%s", s + 1, t + 1), n = strlen(s + 1), m = strlen(t + 1);
  int now = 0;
  for (int i = (2), iend = (m); i <= iend; i++) {
    while (now && t[now + 1] != t[i]) now = p[now];
    if (t[now + 1] == t[i]) now++;
    p[i] = now;
  }
  now = 0;
  for (int i = (1), iend = (n); i <= iend; i++) {
    while (now && t[now + 1] != s[i]) now = p[now];
    if (t[now + 1] == s[i]) now++;
    if (now == m) now = p[now], a[i] = 1;
  }
  lst[0] = -1;
  for (int i = (1), iend = (n); i <= iend; i++)
    lst[i] = a[i] == 1 ? i - m : lst[i - 1];
  pre[0] = 1, g[0] = 1, dp[0] = 1;
  for (int i = (1), iend = (n); i <= iend; i++) {
    if (lst[i] != -1) dp[i] += g[lst[i]], dp[i] %= mod;
    pre[i] = (dp[i] + pre[i - 1]) % mod;
    g[i] = (pre[i] + g[i - 1]) % mod;
  }
  for (int i = (1), iend = (n); i <= iend; i++) ans += dp[i], ans %= mod;
  printf("%d", ans);
  return 0;
}
