#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, mod = 1e9 + 7;
void add(int &a, int b) {
  if ((a += b) >= mod) a -= mod;
}
int z[N + N];
void z_algo(string &s) {
  for (int i = 1, L = 0, R = 0; i < s.size(); i++) {
    if (i <= R) z[i] = min(R - i + 1, z[i - L]);
    while (i + z[i] < s.size() && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > R) R = i + z[i] - 1, L = i;
  }
}
int dp[N][2], n;
int nxt[N], sz;
int solve(int indx, bool flag) {
  if (indx == n) return 1;
  int &ret = dp[indx][flag];
  if (ret != -1) return ret;
  ret = 0;
  if (flag) {
    if (indx + 1 < n) ret = solve(indx + 1, 1);
    add(ret, solve(indx + 1, 0));
  } else {
    ret = solve(indx + 1, 0);
    if (nxt[indx] != -1) add(ret, solve(nxt[indx] + sz - 1, 1));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s, t;
  string temp;
  cin >> s >> t;
  n = s.size(), sz = t.size();
  temp = t + '#' + s;
  z_algo(temp);
  int last = -1;
  for (int i = n - 1; i >= 0; i--) {
    if (z[i + sz + 1] == sz) last = i;
    nxt[i] = last;
  }
  memset(dp, -1, sizeof dp);
  cout << (solve(0, 0) - 1 + mod) % mod << endl;
  return 0;
}
