#include <bits/stdc++.h>
using namespace std;
const int Max = 110000;
const long long mod = 1e9 + 7;
vector<int> find_substring(const string &pattern, const string &text) {
  int n = pattern.size();
  vector<int> next(n + 1, 0);
  for (int i = 1; i < n; i++) {
    int j = i;
    while (j > 0) {
      j = next[j];
      if (pattern[j] == pattern[i]) {
        next[i + 1] = j + 1;
        break;
      }
    }
  }
  vector<int> positions;
  int m = text.size();
  for (int i = 0, j = 0; i < m; i++) {
    if (j < n && text[i] == pattern[j]) {
      j++;
    } else {
      while (j > 0) {
        j = next[j];
        if (text[i] == pattern[j]) {
          j++;
          break;
        }
      }
    }
    if (j == n) {
      positions.push_back(i);
    }
  }
  return positions;
}
vector<int> pre;
string s, t;
int len;
void input() {
  cin >> s >> t;
  len = t.length();
  pre = find_substring(t, s);
  pre.push_back(s.length());
}
long long q1[Max], q2[Max], a[Max];
void solve() {
  memset(q1, 0, sizeof(q1));
  memset(q2, 0, sizeof(q2));
  memset(a, 0, sizeof(a));
  int j = 0;
  int s_l = s.length();
  for (int i = 0; i < s_l; i++) {
    if (i == pre[j]) {
      j++;
      a[i] = q2[i - len] + i - len + 2;
      a[i] %= mod;
    } else {
      a[i] = a[i - 1];
    }
    if (i > 0)
      q1[i] = q1[i - 1] + a[i];
    else
      q1[i] = a[i];
    q1[i] %= mod;
    if (i > 0)
      q2[i] = q2[i - 1] + q1[i];
    else
      q2[i] = q1[i];
    q2[i] %= mod;
  }
  cout << q1[s_l - 1] << endl;
}
int main() {
  input();
  solve();
  return 0;
}
