#include <bits/stdc++.h>
using namespace std;
vector<int> prefixFunction(const string &s) {
  size_t n = s.size();
  vector<int> r(n, 0);
  for (size_t i = 1; i < n; i++) {
    size_t j = r[i - 1];
    while (j && s[i] != s[j]) j = r[j - 1];
    if (s[i] == s[j]) j++;
    r[i] = j;
  }
  return r;
}
char buf[100100];
int dp[100200];
int total[100200];
void Solve() {
  int i, j, k, n, m;
  scanf("%s", (buf));
  string s(buf);
  scanf("%s", (buf));
  string t(buf);
  string com = t + "#" + s;
  vector<int> prefix = prefixFunction(com);
  dp[0] = 0;
  total[0] = 0;
  int tlen = t.length();
  int prev = 0;
  for (i = tlen + 1, j = 1; i < com.length(); i++, j++) {
    if (prefix[i] == tlen) {
      prev = (j - tlen + 1) + total[j - tlen];
      if (prev >= 1000000007) prev -= 1000000007;
    }
    dp[j] = prev + dp[j - 1];
    if (dp[j] >= 1000000007) dp[j] -= 1000000007;
    total[j] = dp[j] + total[j - 1];
    if (total[j] >= 1000000007) total[j] -= 1000000007;
  }
  printf("%d", dp[j - 1]);
}
int main() {
  Solve();
  return 0;
}
