#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s, t;
  cin >> s >> t;
  long long int n1 = s.size();
  long long int n = t.size();
  s = t + '#' + s;
  long long int n2 = s.size();
  vector<long long int> pi(n2);
  pi[0] = 0;
  for (long long int i = 1; i < n2; i++) {
    long long int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) j++;
    pi[i] = j;
  }
  for (long long int i = 0; i < pi.size(); i++)
    if (pi[i] == n)
      pi[i] = 1;
    else
      pi[i] = 0;
  pi.erase(pi.begin(), pi.begin() + n + 1);
  vector<long long int> v;
  v.push_back(0);
  for (long long int i = 0; i < pi.size(); i++) v.push_back(pi[i]);
  vector<long long int> ans(n1 + 1);
  ans[0] = 0;
  vector<long long int> a(n1 + 1, 0), b(n1 + 1, 0);
  for (long long int i = 1; i < n1 + 1; i++) {
    if (v[i] == 0) {
      ans[i] = ans[i - 1];
      a[i] = a[i - 1] + ans[i];
      b[i] = b[i - 1] + a[i];
      ans[i] %= 1000000007;
      a[i] %= 1000000007;
      b[i] %= 1000000007;
    } else {
      ans[i] = b[i - n] + i - n + 1;
      a[i] = a[i - 1] + ans[i];
      b[i] = b[i - 1] + a[i];
      ans[i] %= 1000000007;
      a[i] %= 1000000007;
      b[i] %= 1000000007;
    }
  }
  long long int ans1 = 0;
  for (long long int i = 1; i < n1 + 1; i++) {
    ans1 += ans[i];
    ans1 %= 1000000007;
  }
  cout << ans1;
}
