#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mo = 1e9 + 7;
const unsigned long long sed = 20040509;
char s1[N], s2[N];
bool fl[N];
unsigned long long h[N], ha;
long long dp[N], sum1[N], v = 1, sum2[N];
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  int n = strlen(s1 + 1), m = strlen(s2 + 1);
  for (int i = 1; i <= n; i++) h[i] = h[i - 1] * sed + s1[i] - 'a' + 1;
  for (int i = 1; i <= m; i++) {
    ha = ha * sed + s2[i] - 'a' + 1;
    v *= sed;
  }
  for (int i = m; i <= n; i++) {
    unsigned long long now = h[i] - h[i - m] * v;
    if (now == ha) fl[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (!fl[i])
      dp[i] = dp[i - 1];
    else
      dp[i] = (i - m + 1 + sum2[i - m]) % mo;
    sum1[i] = (sum1[i - 1] + dp[i]) % mo;
    sum2[i] = (sum2[i - 1] + sum1[i]) % mo;
  }
  printf("%lld", sum1[n]);
  return 0;
}
