#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005, MOD = 1e9 + 7;
bool endAt[MAXN];
int kmp[MAXN];
long long g[MAXN], G[MAXN], GG[MAXN], res;
string s, t;
int ns, nt;
void preKMP() {
  for (int i = 1, j = 0; i < nt; i++) {
    while (j && t[i] != t[j]) j = kmp[j - 1];
    if (t[i] == t[j]) j++;
    kmp[i] = j;
  }
}
int dp() {
  for (int i = 1, lastEnd = -1, sum = 0; i <= ns; i++) {
    if (endAt[i]) lastEnd = i;
    if (lastEnd == -1) continue;
    int start = lastEnd - nt;
    g[i] = (GG[start] + start + 1) % MOD;
    G[i] = (G[i - 1] + g[i]) % MOD;
    GG[i] = (GG[i - 1] + G[i]) % MOD;
  }
  return G[ns];
}
int solve() {
  preKMP();
  for (int i = 0, j = 0; i < ns; i++) {
    while (j && s[i] != t[j]) j = kmp[j - 1];
    if (s[i] == t[j]) j++;
    if (j == nt) {
      endAt[i + 1] = true;
      j = kmp[j - 1];
    }
  }
  return dp();
}
int main() {
  ios::sync_with_stdio(false);
  cin >> s >> t;
  ns = s.length();
  nt = t.length();
  cout << solve() << '\n';
  return 0;
}
