#include <bits/stdc++.h>
using namespace std;
vector<int> prefix_function(string s) {
  int n = (int)s.length();
  vector<int> pi(n);
  for (int i = 1; i < n; ++i) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) ++j;
    pi[i] = j;
  }
  return pi;
}
vector<int> pr;
long long a[111111];
long long b[111111];
long long c[111111];
int modulo = 1000000007;
int main() {
  string t, s;
  getline(cin, s);
  getline(cin, t);
  pr = prefix_function(t + '#' + s);
  int j = 1;
  for (int i = t.size() + 1; i < pr.size(); i++) {
    if (pr[i] != t.size()) {
      a[j] = a[j - 1];
      b[j] = b[j - 1] + a[j];
      c[j] = c[j - 1] + b[j];
    } else {
      a[j] = c[j - t.size()] + j - t.size() + 1;
      b[j] = b[j - 1] + a[j];
      c[j] = c[j - 1] + b[j];
    }
    a[j] %= modulo;
    b[j] %= modulo;
    c[j] %= modulo;
    j++;
  }
  cout << b[j - 1] << endl;
  return 0;
}
