#include <bits/stdc++.h>
using namespace std;
const int N = 100001;
const int M = 1000000007;
int dp[N], sum, cur, z[N];
int S, T;
string s, t;
void z_func(string ss) {
  int ns = ss.length();
  z[0] = ns;
  for (int i = 1, l = 0, r = 0; i < ns; i++) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < ns && ss[z[i]] == ss[i + z[i]]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> s >> t;
  T = t.length(), S = s.length();
  for (int i = T; i <= S; i++) {
    sum = (sum + dp[i - T] + 1) % M;
    if (s.compare(i - T, T, t) == 0) cur = sum;
    dp[i] = (dp[i - 1] + cur) % M;
  }
  return cout << dp[S], 0;
}
