#include <bits/stdc++.h>
using namespace std;
const int pw = 107;
const int hmd = 1000000107;
const int md = 1000000007;
int pows[100100];
int hasha[100100];
int hashb;
string sa, sb;
bool cmp[100100];
int gethash(int a, int b) {
  return ((hasha[b] - (long long)hasha[a] * pows[b - a]) % hmd + hmd) % hmd;
}
int dp[100100];
int main() {
  cin >> sa >> sb;
  pows[0] = 1;
  for (int i = 1; i < 100100; i++) {
    pows[i] = ((long long)pows[i - 1] * pw) % hmd;
  }
  for (int i = 0; i < sa.size(); i++) {
    hasha[i + 1] = ((long long)hasha[i] * pw + (sa[i] - 94)) % hmd;
  }
  for (int i = 0; i < sb.size(); i++) {
    hashb = ((long long)hashb * pw + (sb[i] - 94)) % hmd;
  }
  for (int i = 0; i + sb.size() <= sa.size(); i++) {
    if (gethash(i, i + sb.size()) == hashb) {
      cmp[i + sb.size()] = true;
    }
  }
  int prevs = 0;
  int s = 0;
  dp[0] = 1;
  for (int i = 1; i <= sa.size(); i++) {
    if (i >= sb.size()) {
      (s += dp[i - sb.size()]) %= md;
      if (cmp[i]) {
        prevs = s;
      }
    }
    dp[i] = dp[i - 1];
    (dp[i] += prevs) %= md;
  }
  cout << (dp[sa.size()] - 1 + md) % md << endl;
}
