#include <bits/stdc++.h>
using namespace std;
const int X = 100009;
const long long inf = (1ll << 60);
const long long mod = 1000000007;
string s, t;
int n, n1, b, dp[X], val, sum;
int main() {
  cin >> s >> t;
  n = s.size();
  n1 = t.size();
  for (int i = n1; i <= n; i++) {
    sum += (dp[i - n1] + 1) % mod;
    sum %= mod;
    if (s.compare(i - n1, n1, t) == 0) {
      val = sum;
    }
    val %= mod;
    dp[i] = (dp[i - 1] + val) % mod;
  }
  cout << dp[n] % mod << endl;
}
