#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int mod = 1000 * 1000 * 1000 + 7;
string a, b;
int dp[maxn][4];
int PI[maxn];
int n, m;
bool mark[maxn];
vector<pair<long long, long long> > buildPI(string &main, string &pat) {
  vector<pair<long long, long long> > v;
  int m = pat.size();
  PI[0] = 0;
  for (int i = 1; i < m; ++i) {
    int j = PI[i - 1];
    if (j > 0 && pat[j] != pat[i]) j = PI[j - 1];
    if (pat[j] == pat[i]) ++j;
    PI[i] = j;
  }
  int n = main.size();
  for (int i = 0, k = 0; i < n; i++) {
    while (k > 0 && pat[k] != main[i]) {
      k = PI[k - 1];
    }
    if (pat[k] == main[i]) k++;
    if (k == m) {
      v.push_back(pair<long long, long long>(i - m + 1, i));
      mark[i - m + 1] = 1;
      k = PI[k - 1];
    }
  }
  return v;
}
int solve(int ind, int f) {
  if (ind == ((int)((a).size()))) {
    return f == 2;
  }
  int &ret = dp[ind][f];
  if (ret != -1) return ret;
  ret = f == 2;
  if (f == 3) {
    ret += solve(ind + 1, f);
    ret %= mod;
    ret += solve(ind, 1);
    ret %= mod;
  }
  if (f == 2) {
    ret += solve(ind + 1, f);
    ret %= mod;
    ret += solve(ind, 3);
    ret %= mod;
  }
  if (f == 1) {
    if (mark[ind]) {
      ret += solve(ind + m, 2);
      ret %= mod;
    } else
      ret += solve(ind + 1, f), ret %= mod;
  }
  return ret;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> a >> b;
  n = ((int)((a).size())), m = ((int)((b).size()));
  buildPI(a, b);
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 3) % mod << "\n";
}
