#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100, MOD = 1e9 + 7;
int dp[N];
string s, t;
int val, sum;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> s >> t;
  int n = s.size();
  int m = t.size();
  for (int i = m; i <= n; i++) {
    sum = (sum + dp[i - m] + 1) % MOD;
    string tmp = s.substr(i - m, m);
    if (tmp == t) val = sum;
    dp[i] = (dp[i - 1] + val) % MOD;
  }
  return cout << dp[n], 0;
}
