#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   long long n, m;   char s[111111], t[111111];   bool ar[111111];   long long fail[111111], f[111111], ff[111111], dp[111111];   void kmp() {     int i = 0, j = -1;     fail[0] = -1;     while (i < m) {       while (j > -1 && t[i] != t[j]) j = fail[j];       i++, j++;       fail[i] = j;     }     i = 1, j = 0;     while (i <= n) {       while (j > -1 && s[i] != t[j]) j = fail[j];       j++;       if (j == m) ar[i] = 1, j = fail[j];       i++;     }   }   int main() {     scanf( %s , s + 1);     scanf( %s , t);     n = strlen(s + 1);     m = strlen(t);     kmp();     for (int i = 1; i <= n; i++) dp[i] = (ar[i] ? i - m + 1 : dp[i - 1]);     for (int i = 1; i <= n; i++) {       int l = dp[i];       if (l) {         f[i] = (f[i - 1] + l) % mod;         f[i] = (f[i] + ff[l - 1]) % mod;         ff[i] = (ff[i - 1] + f[i]) % mod;       }     }     cout << f[n] << endl;     return 0;   }   