#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int N = 1e5 + 3, mod = 1e9 + 7;
int dp[N], pre[N];
string s, t;
bool endt[N];
void kmp(const string& s, const string& t) {
  string tem = t + '#' + s;
  vector<int> p(((int)(tem).size()) + 1, 0);
  for (int i = (2); i <= (((int)(tem).size())); ++i) {
    int j = p[i - 1];
    while (j && tem[i - 1] != tem[j]) j = p[j];
    p[i] = j + (tem[i - 1] == tem[j]);
    if (p[i] == ((int)(t).size())) endt[i - ((int)(t).size()) - 1] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> s >> t;
  kmp(s, t);
  int n = ((int)(s).size()), lst = -1;
  dp[0] = pre[0] = 1;
  for (int i = (1); i <= (n); ++i) {
    dp[i] = dp[i - 1];
    if (endt[i]) lst = i;
    if (lst != -1) dp[i] = (dp[i] + pre[lst - ((int)(t).size())]) % mod;
    pre[i] = (pre[i - 1] + dp[i]) % mod;
  }
  cout << (dp[n] - 1 + mod) % mod;
  return 0;
}
