#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 100;
const int M = (int)1e9 + 7;
long long sum[maxn], dp[maxn];
char s[maxn], t[maxn];
int f[maxn];
int vis[maxn];
vector<int> pos;
int n, m;
void getFail(char *a, int len) {
  f[0] = f[1] = 0;
  for (int i = 1; i < len; i++) {
    int j = f[i];
    while (j && a[j] != a[i]) j = f[j];
    if (a[j] == a[i])
      f[i + 1] = j + 1;
    else
      f[i + 1] = 0;
  }
}
void KMP(char *a, char *b, int len1, int len2) {
  getFail(b, len2);
  int j = 0;
  for (int i = 0; i < len1; i++) {
    while (j && a[i] != b[j]) j = f[j];
    if (a[i] == b[j]) j++;
    if (j == len2) {
      vis[i] = 1, pos.push_back(i);
    }
  }
}
int pre[maxn];
int main() {
  scanf("%s%s", s, t);
  n = strlen(s);
  m = strlen(t);
  KMP(s, t, n, m);
  long long ans = 0;
  if (pos.size() == 0)
    cout << 0 << endl;
  else {
    for (int i = 1; i <= n; i++) {
      int k = upper_bound(pos.begin(), pos.end(), i - 1) - pos.begin();
      if (k == 0) {
      } else {
        k--;
        dp[i] = (pre[pos[k] - m + 1] + pos[k] - m + 2 + dp[i]) % M;
        ans = (ans + dp[i]) % M;
      }
      sum[i] = (sum[i - 1] + dp[i]) % M;
      pre[i] = (pre[i - 1] + sum[i]) % M;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
