#include <bits/stdc++.h>
using namespace std;
const int mmod = 1000000007;
const int T = 3;
const int hash_value[T] = {31, 37, 43};
int pw[T][111111];
int hash_s[T][111111];
int hash_t[T];
int ppw(int a, int b) {
  if (b == 0) return 1;
  int c = ppw(a, b / 2);
  c = (1LL * c * c) % mmod;
  if (b % 2) c = (1LL * c * a) % mmod;
  return c;
}
int res[111111];
int main() {
  for (int i = 0; i < T; i++) {
    pw[i][0] = 1;
    for (int j = 1; j <= 101010; j++)
      pw[i][j] = (1LL * pw[i][j - 1] * hash_value[i]) % mmod;
  }
  string s, t;
  cin >> s >> t;
  int s_len = s.size();
  int t_len = t.size();
  if (t_len > s_len) {
    printf("0\n");
    return 0;
  }
  for (int i = 0; i < T; i++) {
    hash_s[i][0] = 0;
    hash_t[i] = 0;
    for (int j = 0; j < s_len; j++)
      hash_s[i][j + 1] = (hash_s[i][j] + 1LL * pw[i][j] * s[j]) % mmod;
    for (int j = 0; j < t_len; j++)
      hash_t[i] = (hash_t[i] + 1LL * pw[i][j] * t[j]) % mmod;
  }
  res[0] = 1;
  int sum = 0;
  int target = 0;
  int t2 = 1;
  int ok2 = 0;
  for (int i = t_len - 1; i < s_len; i++) {
    sum = (sum + res[i - t_len + 1]) % mmod;
    target = (target + sum) % mmod;
    int ok = 1;
    for (int j = 0; j < 3; j++) {
      int hs = hash_s[j][i + 1] - hash_s[j][i + 1 - t_len];
      if (hs < 0) hs += mmod;
      if (hs != (1LL * hash_t[j] * ppw(hash_value[j], i + 1 - t_len)) % mmod)
        ok = 0;
    }
    if (ok) t2 = target;
    ok2 += ok;
    if (ok2) res[i + 1] = t2;
  }
  sum = 0;
  for (int i = 1; i <= s_len; i++) sum = (sum + res[i]) % mmod;
  cout << sum << endl;
}
