#include <bits/stdc++.h>
using namespace std;
string str, t;
const int MOD = 1000000007;
const int max_n = 100010;
int f[max_n];
long long s[max_n];
long long q1[max_n];
long long q2[max_n];
bool a[max_n];
void calc() {
  int k = 0;
  f[0] = f[1] = 0;
  for (int i = 1; i < t.length(); i++) {
    while (k > 0 && t[i] != t[k]) k = f[k];
    if (t[i] == t[k]) k++;
    f[i + 1] = k;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> str >> t;
  int n = str.length(), m = t.length();
  calc();
  int k = 0;
  for (int i = 0; i < str.length(); i++) {
    while (k > 0 && str[i] != t[k]) k = f[k];
    if (str[i] == t[k]) k++;
    if (k == m) {
      a[i] = 1;
      k = f[k];
    }
  }
  if (a[0] == 1) q1[0] = q2[0] = s[0] = 1;
  for (int i = 1; i < str.length(); i++) {
    if (!a[i])
      s[i] = s[i - 1];
    else {
      s[i] = (q2[i - m] + i - m + 2) % MOD;
    }
    q1[i] = (q1[i - 1] + s[i]) % MOD;
    q2[i] = (q2[i - 1] + q1[i]) % MOD;
  }
  cout << q1[n - 1] << endl;
  return 0;
}
