#include <bits/stdc++.h>
using namespace std;
const int N = 200009;
const int mod = (int)1e9 + 7;
int p[N];
int d[N];
int pd[N];
int ppd[N];
int main() {
  string a, b;
  cin >> a >> b;
  string c = b + "#" + a;
  int n = (int)a.length();
  int m = (int)b.length();
  for (int i = 1; i < n + m + 1; i++) {
    int j = p[i - 1];
    while (j > 0 && c[i] != c[j]) {
      j = p[j - 1];
    }
    if (c[i] == c[j]) {
      j++;
    }
    p[i] = j;
  }
  for (int i = 1; i <= n; i++) {
    if (p[i + m] == m) {
      d[i] = (((ppd[i - m] + 0LL + i - m + 1) % mod) + mod) % mod;
    } else {
      d[i] = d[i - 1];
    }
    pd[i] = (pd[i - 1] + 0LL + d[i]) % mod;
    ppd[i] = (ppd[i - 1] + 0LL + pd[i]) % mod;
  }
  cout << pd[n] << endl;
  return 0;
}
