#include <bits/stdc++.h>
using namespace std;
const int N = 100100, MOD = 1e9 + 7;
int n, m, i, j, ans, pi[N * 3], nxt[N], dp[N][2];
string t, p;
void KMP(const string& str) {
  for (i = 1, j = 0; i < str.size(); ++i) {
    while (j > 0 && str[i] != str[j]) j = pi[j - 1];
    if (str[i] == str[j]) ++j;
    pi[i] = j;
  }
}
int solve(int idx, bool flag = 1) {
  if (idx >= n) return 1;
  int& ret = dp[idx][flag];
  if (~ret) return ret;
  ret = solve(idx + 1, flag) % MOD;
  if (flag) ret = (ret + solve(idx + 1, 0)) % MOD;
  if (nxt[idx] != -1) ret = (ret + solve(nxt[idx])) % MOD;
  return ret;
}
int main() {
  cin >> t >> p;
  n = t.size();
  m = p.size();
  KMP(p + "#" + t);
  memset(dp, -1, sizeof(dp));
  for (i = n - 1, nxt[n] = -1; i >= 0; --i)
    nxt[i] = (pi[i + m * 2] == m) ? i + m : nxt[i + 1];
  for (i = 0; i < n; ++i)
    if (nxt[i] != -1) ans = (ans + solve(nxt[i])) % MOD;
  cout << ans;
  return 0;
}
