#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int mod = 1e9 + 7;
int n, m;
string s, t;
int link[N];
int last[N];
int F[N][2];
int sumF[N][2];
void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s >> t;
  n = s.size(), m = t.size();
  s = '~' + s, t = '~' + t;
  link[1] = 0;
  int cur = 0;
  for (int i = 2; i <= m; ++i) {
    while (cur > 0 && t[cur + 1] != t[i]) cur = link[cur];
    if (t[i] == t[cur + 1]) cur++;
    link[i] = cur;
  }
  cur = 0;
  for (int i = 1; i <= n; ++i) {
    while (cur > 0 && t[cur + 1] != s[i]) cur = link[cur];
    if (s[i] == t[cur + 1]) cur++;
    if (cur == m) last[i - m + 1] = i - m + 1;
  }
  for (int i = 1; i <= n; ++i)
    if (last[i] == 0) {
      last[i] = last[i - 1];
    }
  for (int i = 1; i <= n; ++i) {
    F[i][0] = sumF[i - 1][1];
    add(F[i][0], 1);
    sumF[i][0] = sumF[i - 1][0];
    add(sumF[i][0], F[i][0]);
    if (i - m + 1 > 0 && last[i - m + 1] > 0)
      F[i][1] = sumF[last[i - m + 1]][0];
    sumF[i][1] = sumF[i - 1][1];
    add(sumF[i][1], F[i][1]);
  }
  cout << sumF[n][1] << '\n';
}
