#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  string s, t;
  cin >> s >> t;
  int S = (int)s.length();
  int T = (int)t.length();
  vector<int> dp(S + 1, 0);
  for (int sum, here = 0, i = T; i <= S; ++i) {
    sum = (sum + dp[i - T] + 1) % MOD;
    if (s.compare(i - T, T, t) == 0) {
      here = sum;
    }
    dp[i] = (dp[i - 1] + here) % MOD;
  }
  cout << dp[S] << "\n";
  return 0;
}
