#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, l;
long long dp[100005], sum, temp, M = 1e9 + 7;
int main() {
  cin >> s >> t;
  n = s.length();
  l = t.length();
  for (int i = l; i <= n; i++) {
    sum = (sum + dp[i - l] + 1) % M;
    if (s.compare(i - l, l, t) == 0) temp = sum;
    dp[i] = (dp[i - 1] + temp) % M;
  }
  cout << dp[n] << endl;
  return 0;
}
