#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int mod = 1000000007;
char s[MAXN], t[MAXN];
int dp[MAXN], sum[MAXN], sum2[MAXN];
long long h[MAXN];
int main() {
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  int n = (int)strlen(s + 1);
  int m = (int)strlen(t + 1);
  if (m > n)
    puts("0");
  else {
    long long ht = 0;
    for (int i = 1; i <= n; ++i) {
      ht = h[i] = ht * 131 + s[i];
    }
    dp[0] = sum[0] = sum2[0] = 1;
    long long h0 = 0, p = 1;
    for (int i = 1; i <= m; ++i) {
      h0 = h0 * 131 + t[i];
      p = p * 131;
      dp[i] = 0;
      sum[i] = (dp[i] + sum[i - 1]) % mod;
      sum2[i] = (sum[i] + sum2[i - 1]) % mod;
    }
    int o = -1;
    for (int i = m; i <= n; ++i) {
      long long h1 = h[i] - h[i - m] * p;
      if (h0 == h1) {
        o = i - m;
      }
      if (o != -1) {
        dp[i] = sum2[o];
      } else
        dp[i] = 0;
      sum[i] = (sum[i - 1] + dp[i]) % mod;
      sum2[i] = (sum2[i - 1] + sum[i]) % mod;
    }
    int ans = (sum[n] + mod - 1) % mod;
    printf("%d\n", ans);
  }
  return 0;
}
