#include <bits/stdc++.h>
int n, m, fail[100100], dp[100100], sum1[100100], sum2[100100];
bool flag[100100];
char s[100100], t[100100];
inline void getfail() {
  int k = 0;
  fail[1] = 0;
  for (int i = 2; i <= m; ++i) {
    while (k && t[k + 1] != t[i]) k = fail[k];
    if (t[k + 1] == t[i]) ++k;
    fail[i] = k;
  }
}
int main() {
  scanf("%s%s", s + 1, t + 1);
  n = strlen(s + 1);
  m = strlen(t + 1);
  getfail();
  int k = 0;
  for (int i = 1; i <= n; ++i) {
    while (k && t[k + 1] != s[i]) k = fail[k];
    if (t[k + 1] == s[i]) ++k;
    if (k == m) flag[i] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (flag[i]) {
      dp[i] = (i - m + 1 + sum2[i - m]) % 1000000007;
    } else
      dp[i] = dp[i - 1];
    sum1[i] = (sum1[i - 1] + dp[i]) % 1000000007;
    sum2[i] = (sum2[i - 1] + sum1[i]) % 1000000007;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans = (ans + dp[i]) % 1000000007;
  printf("%d\n", ans);
  return 0;
}
