#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 2e5;
vector<int> g[N];
int a[N], z[N], Z[N], dp[N], ways[N];
void go(string s) {
  int n = s.length();
  z[0] = n;
  int L, R, i;
  L = R = 0;
  for (i = 1; i < n; i++) {
    if (i > R) {
      L = R = i;
      while (R < n and s[R] == s[R - L]) R++;
      z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < n and s[R] == s[R - L]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
int mpow(int base, int exp);
void ipgraph(int n, int m);
void dfs(int u, int par);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, n, m, k;
  string s, t;
  cin >> s >> t;
  n = s.size();
  m = t.size();
  string c = t + '#' + s;
  go(c);
  set<int> ans;
  ans.insert(n);
  for (i = 0; i < n; i++) {
    Z[i] = z[m + 1 + i];
    if (Z[i] == m) ans.insert(i);
  }
  n = c.size();
  int dp_end[n], dp_total[n], sum_total[n];
  memset(dp_end, 0, sizeof(dp_end));
  memset(dp_total, 0, sizeof(dp_total));
  memset(sum_total, 0, sizeof(sum_total));
  m = t.size();
  for (int i = 2 * m; i < n; i++) {
    dp_end[i] = ((z[i - m + 1] == m) ? ((i - 2 * m + 1) + sum_total[i - m])
                                     : dp_end[i - 1]) %
                mod;
    dp_total[i] = (dp_total[i - 1] + dp_end[i]) % mod;
    sum_total[i] = (sum_total[i - 1] + dp_total[i]) % mod;
  }
  cout << dp_total[n - 1] << "\n";
  return 0;
}
int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % mod;
    base = ((long long)base * base) % mod;
    exp >>= 1;
  }
  return result;
}
void ipgraph(int n, int m) {
  int i, u, v;
  while (m--) {
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
}
void dfs(int u, int par) {
  for (int v : g[u]) {
    if (v == par) continue;
    dfs(v, u);
  }
}
