#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100005;
const long long MOD = 1e9 + 7;
long long n1, n2, nex[MAXN], ok[MAXN], s1[MAXN], s2[MAXN], dp[MAXN];
char str1[MAXN], str2[MAXN];
long long add(long long x, long long y) {
  long long ret = x + y;
  if (ret >= MOD) {
    return ret - MOD;
  }
  return ret;
}
void get_next() {
  nex[1] = 0;
  long long k = 0;
  for (long long i = 2; i <= n2; i++) {
    while (k > 0 && str2[k + 1] != str2[i]) {
      k = nex[k];
    }
    if (str2[k + 1] == str2[i]) {
      k++;
    }
    nex[i] = k;
  }
}
void kmp() {
  long long k = 0;
  for (long long i = 1; i <= n1; i++) {
    while (k > 0 && str2[k + 1] != str1[i]) {
      k = nex[k];
    }
    if (str2[k + 1] == str1[i]) {
      k++;
    }
    if (k == n2) {
      ok[i] = 1;
    }
  }
}
int main() {
  scanf("%s", str1 + 1);
  n1 = strlen(str1 + 1);
  scanf("%s", str2 + 1);
  n2 = strlen(str2 + 1);
  get_next();
  kmp();
  for (long long i = 1; i <= n1; i++) {
    if (!ok[i]) {
      dp[i] = dp[i - 1];
    } else {
      dp[i] = add(i - n2 + 1, s2[i - n2]);
    }
    s1[i] = add(s1[i - 1], dp[i]);
    s2[i] = add(s2[i - 1], s1[i]);
  }
  long long ans = 0;
  for (long long i = 1; i <= n1; i++) {
    ans = add(ans, dp[i]);
  }
  printf("%lld\n", ans);
}
