#include <bits/stdc++.h>
const int maxn = 100010, pri = (1e9) + 7;
int next[maxn], q[maxn], a[maxn], b[maxn], c[maxn];
char s[maxn], t[maxn];
int main() {
  scanf("%s%s", s, t);
  int lens = strlen(s), lent = strlen(t), sum = 0;
  next[0] = next[1] = 0;
  for (int i = 1, j; i < lent; i++) {
    j = next[i];
    while (j && t[i] != t[j]) j = next[j];
    next[i + 1] = (t[i] == t[j]) ? j + 1 : 0;
  }
  for (int i = 0, len = -1; i < lens; i++) {
    if (len == -1 && s[i] == t[0])
      len = 0;
    else {
      while (len >= 0 && s[i] != t[len + 1]) len = next[len + 1] - 1;
      if (len == -1 && s[i] == t[0])
        len = 0;
      else if (s[i] == t[len + 1])
        len++;
    }
    q[i] = len;
    if (len == lent - 1) len = next[len + 1] - 1;
  }
  if (q[lent - 1] == lent - 1) {
    a[lent - 1] = 1;
    b[lent - 1] = 1;
    c[lent - 1] = 1;
  }
  for (int i = lent; i < lens; i++) {
    if (q[i] != lent - 1) {
      a[i] = a[i - 1];
      b[i] = (b[i - 1] + a[i]) % pri;
      c[i] = (c[i - 1] + b[i]) % pri;
    } else {
      a[i] = (c[i - lent] + i - lent + 2) % pri;
      b[i] = (b[i - 1] + a[i]) % pri;
      c[i] = (c[i - 1] + b[i]) % pri;
    }
  }
  printf("%d\n", b[lens - 1]);
}
