#include <bits/stdc++.h>
using namespace std;
string s, t;
int dp[200005];
int q1[200005];
int q2[200005];
int zarr[200005];
bool good[200005];
void buildzarr() {
  int l = 0, r = 0;
  for (int i = 1; i < s.size(); i++) {
    if (i > r) {
      l = r = i;
      while (r < s.size() && s[r - l] == s[r]) {
        r++;
      }
      zarr[i] = r - l;
      r--;
    } else {
      int k = i - l;
      if (zarr[k] < r - i + 1) {
        zarr[i] = zarr[k];
      } else {
        l = i;
        while (r < s.size() && s[r - l] == s[r]) {
          r++;
        }
        zarr[i] = r - l;
        r--;
      }
    }
  }
}
int main() {
  cin >> s >> t;
  s = t + '$' + s;
  buildzarr();
  for (int i = 0; i < s.size(); i++) {
    if (zarr[i] == t.size()) {
      good[i - 1] = 1;
    }
  }
  for (int i = 1; i <= s.size() - t.size() - 1; i++) {
    if (good[i]) {
      dp[i] = (i - t.size() + 1 + q2[i - t.size()]) % 1000000007;
    } else {
      dp[i] = dp[i - 1];
    }
    q1[i] = (q1[i - 1] + dp[i]) % 1000000007;
    q2[i] = (q2[i - 1] + q1[i]) % 1000000007;
  }
  cout << q1[s.size() - t.size() - 1] << '\n';
  return 0;
}
