#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 100005;
char s[MAX], t[MAX];
int p[MAX];
long long dp[MAX][3];
int n, m;
void pre() {
  int i = 0, j = -1;
  p[0] = -1;
  while (i < m) {
    while (j >= 0 && t[i] != t[j]) j = p[j];
    i++;
    j++;
    p[i] = j;
  }
}
void kmp() {
  int i = 0, j = 0;
  while (i < n) {
    while (j >= 0 && s[i] != t[j]) j = p[j];
    i++;
    j++;
    if (j == m) {
      dp[i][0] = (i - m >= 0 ? dp[i - m][2] : 0) + i - m + 1;
      j = p[j];
    } else {
      dp[i][0] = (i > 0 ? dp[i - 1][0] : 0);
    }
    dp[i][0] %= MOD;
    dp[i][1] = (i > 0 ? dp[i - 1][1] : 0) + dp[i][0];
    dp[i][1] %= MOD;
    dp[i][2] = (i > 0 ? dp[i - 1][2] : 0) + dp[i][1];
    dp[i][2] %= MOD;
  }
}
int main() {
  cin >> s >> t;
  n = strlen(s);
  m = strlen(t);
  pre();
  kmp();
  long long ans = 0;
  cout << dp[n][1] << endl;
  return 0;
}
