#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
template <class T>
void read(T &x) {
  char ch;
  while ((ch = getchar()) && !isdigit(ch))
    ;
  x = ch - '0';
  while ((ch = getchar()) && isdigit(ch)) x = x * 10 + ch - '0';
}
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) : x(_x), y(_y) {}
};
long long Pow(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long Pow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    a = a * a;
  }
  return res;
}
const int N = 120000;
const long long Mod = 1000000007LL;
int nxt[N], up[N];
long long dp[N], ans;
char s1[N], s2[N];
void KMP(int l) {
  int j = 0;
  for (int i = 2; i <= l; i++) {
    while (j && s2[j + 1] != s2[i]) j = nxt[j];
    if (s2[j + 1] == s2[i]) j++;
    nxt[i] = j;
  }
}
int main() {
  scanf("%s%s", s1 + 1, s2 + 1);
  int l1 = strlen(s1 + 1), l2 = strlen(s2 + 1);
  KMP(l2);
  int j = 0;
  up[0] = -1;
  for (int i = 1; i <= l1; i++) {
    up[i] = up[i - 1];
    while (j && s1[i] != s2[j + 1]) j = nxt[j];
    if (s1[i] == s2[j + 1]) j++;
    if (j == l2) up[i] = i - l2, j = nxt[j];
  }
  dp[0] = 1;
  ans = 1;
  for (int i = 1; i <= l1; i++) {
    if (up[i] != -1) ans = (ans + dp[up[i]]) % Mod;
    dp[i] = (dp[i - 1] + ans) % Mod;
  }
  ans--;
  printf("%lld\n", (ans + Mod) % Mod);
}
