#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
const int mod = 1e9 + 7;
char a[N], b[N];
long long A[N], B[N], pw[N];
int len_a, len_b;
long long dp[N], dps[N], dpt[N];
inline bool calc(int st, int en) {
  if (st < 0 || st > N || en < 0 || en > N) return 0;
  return (A[en] - A[st - 1] * pw[en - st + 1]) == B[len_b];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> (a + 1) >> (b + 1);
  len_a = strlen(a + 1), len_b = strlen(b + 1);
  pw[0] = 1;
  for (int i = 1; i < N; i++) pw[i] = pw[i - 1] * 101;
  A[0] = B[0] = 0;
  for (int i = 1; i <= len_a; i++) A[i] = A[i - 1] * 101 + a[i];
  for (int i = 1; i <= len_b; i++) B[i] = B[i - 1] * 101 + b[i];
  dp[0] = dps[0] = dpt[0] = 0;
  int last = 0;
  for (int i = 1; i <= len_a; i++) {
    if (calc(i - len_b + 1, i)) {
      dp[i] = dp[i - 1] + i - len_b + 1 - last;
      long long rest = dpt[i - len_b];
      if (last) rest = (rest + mod - dpt[last - 1]) % mod;
      dp[i] = (dp[i] + rest) % mod;
      dps[i] = (dps[i - 1] + dp[i]) % mod;
      dpt[i] = (dpt[i - 1] + dps[i]) % mod;
      last = i - len_b + 1;
    } else {
      dp[i] = dp[i - 1];
      dps[i] = (dps[i - 1] + dp[i]) % mod;
      dpt[i] = (dpt[i - 1] + dps[i]) % mod;
    }
  }
  int ans = 0;
  for (int i = 1; i <= len_a; i++) {
    cerr << i << " " << a[i] << " " << dp[i] << endl;
    ans = (ans + dp[i]) % mod;
  }
  cout << ans << endl;
  return 0;
}
