#include <bits/stdc++.h>
using namespace std;
string s, t;
int n, m, len, l, r, ans, z[200200], dp[200200], ps1[200200], ps2[200200];
bool b[200200];
void zfunc(string st, int* zar) {
  len = st.length();
  l = r = 0;
  for (int i = 1; i < len; i++) {
    if (i > r) {
      l = r = i;
      while (r < len && st[r - l] == st[r]) r++;
      zar[i] = r - l;
      r--;
    } else {
      int k = i - l;
      if (zar[k] < r - i + 1)
        zar[i] = zar[k];
      else {
        l = i;
        while (r < len && st[r - l] == st[r]) r++;
        zar[i] = r - l;
        r--;
      }
    }
  }
}
int main() {
  if (fopen("input.in", "r")) freopen("input.in", "r", stdin);
  cin >> s >> t;
  n = s.length();
  m = t.length();
  zfunc(t + s, z);
  for (int i = m; i < n + m; i++) b[i - 1] = (z[i] >= m);
  dp[0] = ps1[0] = ps2[0] = 1;
  if (m == 1 && t[0] == s[0])
    dp[1] = 1;
  else
    dp[1] = 0;
  ps1[1] = dp[1] + dp[0];
  ps2[1] = ps2[0] + ps1[1];
  for (int i = 1; i < n; i++) {
    if (b[i]) {
      if (i - m + 1 < 0) continue;
      dp[i + 1] = (ps2[i - m + 1]) % 1000000007;
    } else {
      dp[i + 1] = dp[i];
    }
    ps1[i + 1] = (ps1[i] + dp[i + 1]) % 1000000007;
    ps2[i + 1] = (ps2[i] + ps1[i + 1]) % 1000000007;
  }
  for (int i = 1; i <= n; i++) ans = (ans + dp[i]) % 1000000007;
  cout << ans << endl;
  return 0;
}
