#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100100;
const int MOD = 1000000007;
int p[MAX_N];
int k[MAX_N];
int last[MAX_N];
int d[MAX_N];
int sp[MAX_N];
int spp[MAX_N];
int n, m;
void prefix(string &s, int n) {
  int x = 0;
  for (int i = 2; i <= n; i++) {
    while (x && s[x + 1] != s[i]) {
      x = p[x];
    }
    if (s[x + 1] == s[i]) {
      x++;
    }
    p[i] = x;
  }
}
void kmp(string &s, string &t, int n, int m) {
  int x = 0;
  last[0] = 1;
  for (int i = 1; i <= n; i++) {
    while (x && s[i] != t[x + 1]) {
      x = p[x];
    }
    if (s[i] == t[x + 1]) {
      x++;
    }
    k[i] = x;
  }
}
int dinamic(int n, int m) {
  int last = -1;
  for (int i = 1; i <= n; i++) {
    if (k[i] == m) {
      last = i - m;
    }
    if (last != -1) {
      d[i] = (last + 1 + spp[last]) % MOD;
    }
    sp[i] = (sp[i - 1] + d[i]) % MOD;
    spp[i] = (spp[i - 1] + sp[i]) % MOD;
  }
  return sp[n];
}
int main() {
  string s, t;
  cin >> s >> t;
  int n = s.size();
  int m = t.size();
  s = ' ' + s;
  t = ' ' + t;
  prefix(t, m);
  kmp(s, t, n, m);
  cout << dinamic(n, m);
  return 0;
}
