#include <bits/stdc++.h>
using namespace std;
;
char s[200007];
char pat[200007];
char pattern[200007];
char text[200007];
int pre[200007];
int ans[200007];
int s1[200007];
int s2[200007];
vector<int> v;
set<int> st;
int psz;
int tsz;
long int h[10000000];
void compute_func() {
  long long plen = strlen(pattern);
  plen--;
  h[0] = -1;
  long long int k = -1;
  for (long long int q = 1; q <= plen; q++) {
    while (k > -1 && pattern[k + 1] != pattern[q]) k = h[k];
    if (pattern[k + 1] == pattern[q]) k = k + 1;
    h[q] = k;
  }
}
void kmpi() {
  long long tlen = strlen(text);
  long long plen = strlen(pattern);
  plen--;
  long long int q = -1;
  for (long long int i = 0; i < tlen; i++) {
    while (q > -1 && pattern[q + 1] != text[i]) q = h[q];
    if (pattern[q + 1] == text[i]) q = q + 1;
    if (q == plen) {
      v.push_back(i);
      st.insert(i);
      q = h[q];
    }
  }
}
void prefix() {
  pre[0] = 0;
  long long k = 0;
  for (long long i = 1; i < psz; i++) {
    while (k > 0 and pattern[i] != pattern[k]) k = pre[k - 1];
    if (pattern[i] == pattern[k]) k++;
    pre[i] = k;
  }
  for (int i = 0; i < psz; i++) h[i] = pre[i] - 1;
}
void kmp() {
  long long match = 0;
  for (long long i = 0; i < tsz; i++) {
    while (match > 0 and text[i] != pattern[match]) match = pre[match - 1];
    if (pattern[match] == text[i]) match++;
    if (match == psz) {
      v.push_back(i);
      st.insert(i);
      match = pre[match - 1];
    }
  }
}
int main() {
  scanf("%s", text);
  scanf("%s", pattern);
  tsz = strlen(text);
  psz = strlen(pattern);
  compute_func();
  prefix();
  kmpi();
  for (int i = 0; i < tsz; i++) {
    if (st.find(i) == st.end()) {
      if (i == 0) {
        s1[i] = s2[i] = 0;
        ans[i] = 0;
      } else {
        ans[i] = ans[i - 1];
        s1[i] = ans[i] + s1[i - 1];
        s1[i] %= 1000000007;
        s2[i] = s1[i] + s2[i - 1];
        s2[i] %= 1000000007;
      }
    } else {
      if (i == 0) {
        ans[i] = s1[i] = s2[i] = 1;
        continue;
      }
      int x = i - psz + 2 + s2[i - psz] + 1000000007;
      x %= 1000000007;
      ans[i] = x;
      ans[i] %= 1000000007;
      s1[i] = s1[i - 1] + x;
      s1[i] %= 1000000007;
      s2[i] = s2[i - 1] + s1[i];
      s2[i] %= 1000000007;
    }
  }
  int fans = 0;
  for (int i = 0; i < tsz; i++) {
    fans = fans + ans[i];
    if (fans >= 1000000007) fans -= 1000000007;
  }
  cout << fans << endl;
  return 0;
}
