#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int dp[100001];
int main() {
  ios::sync_with_stdio(false);
  string S, T;
  cin >> S >> T;
  int s = S.size(), t = T.size();
  int sum = 0, cur = 0;
  for (int i = t; i <= s; i++) {
    sum = (sum + dp[i - t] + 1) % MOD;
    if (S.compare(i - t, t, T) == 0) {
      cur = sum;
    }
    dp[i] = (dp[i - 1] + cur) % MOD;
  }
  cout << dp[s] << endl;
  return 0;
}
