#include <bits/stdc++.h>
using namespace std;
long long d[100005];
long long sum[100005];
long long rec(vector<int>& start, int v) {
  if (v >= start.size()) return 0;
  if (start[v] == -1) return 0;
  if (d[v] != -1) return sum[v - 1];
  d[v] = rec(start, v + 1);
  sum[v] = (d[v] + sum[v + 1]) % 1000000007;
  d[v] = (d[v] + (rec(start, start[v] + 1) + start.size() - start[v])) %
         1000000007;
  return d[v];
}
int main() {
  memset(d, -1, sizeof(d));
  memset(sum, 0, sizeof(sum));
  string s, t;
  cin >> s >> t;
  string bigstr = t + '#' + s;
  vector<int> prefix(bigstr.length());
  prefix[0] = 0;
  for (int i = 1; i < bigstr.length(); i++) {
    int j = prefix[i - 1];
    while (j > 0 && bigstr[i] != bigstr[j]) j = prefix[j - 1];
    if (bigstr[i] == bigstr[j]) ++j;
    prefix[i] = j;
  }
  vector<int> start(s.length(), -1);
  int tlength = t.length();
  for (int i = bigstr.length() - 1; i > tlength; i--) {
    if (i != bigstr.length() - 1 && start[i - tlength - 1] == -1)
      start[i - tlength - 1] = start[i - tlength];
    if (prefix[i] == tlength) {
      if (i - tlength - tlength >= 0)
        start[i - tlength - tlength] = i - tlength - 1;
    }
  }
  cout << rec(start, 0);
  return 0;
}
