#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int size = 100010;
int len1, len2;
char s[size], t[size];
long long dp[size], dp2[size], dp3[size];
int Next[size];
bool flag[size];
void getNext() {
  int i = 1, j = 0;
  Next[1] = 0;
  while (i <= len2) {
    if (j == 0 || t[i] == t[j]) {
      i++;
      j++;
      Next[i] = j;
    } else {
      j = Next[j];
    }
  }
}
void kmp() {
  getNext();
  int i = 1, j = 1;
  while (i <= len1) {
    if (j == 0 || s[i] == t[j]) {
      j++;
      if (j == len2 + 1) {
        flag[i] = true;
        j = Next[j];
      }
      i++;
    } else {
      j = Next[j];
    }
  }
}
int main() {
  memset(flag, false, sizeof(flag));
  cin >> (s + 1) >> (t + 1);
  len1 = strlen(s + 1);
  len2 = strlen(t + 1);
  kmp();
  dp[0] = dp2[0] = dp[3] = 0;
  for (int i = 1; i <= len1; i++) {
    if (!flag[i]) {
      dp[i] = dp[i - 1];
      dp2[i] = (dp[i] + dp2[i - 1]) % mod;
    } else {
      dp[i] = dp3[i - len2] + i - len2 + 1;
      dp2[i] = (dp[i] + dp2[i - 1]) % mod;
    }
    dp3[i] = (dp3[i - 1] + dp2[i]) % mod;
  }
  cout << dp2[len1] << endl;
  return 0;
}
