#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 5;
const int MOD = 1e9 + 7;
string s, t;
int kmp_arr[MX];
long long dp[MX], q1[MX], q2[MX], loc[MX];
void kmp_preprocess(const string& s) {
  int j = 0;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] != s[j]) {
      kmp_arr[i] = 0;
      if (j > 0) {
        j = kmp_arr[j - 1];
        i--;
      }
    } else {
      kmp_arr[i] = j + 1;
      j++;
    }
  }
}
void kmp(const string& s, const string& t) {
  int j = 0;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] == t[j]) {
      j++;
    } else {
      if (j > 0) {
        j = kmp_arr[j - 1];
        i--;
      }
    }
    if (j == t.length()) loc[i] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s >> t;
  s.insert(s.begin(), 'a');
  kmp_preprocess(t);
  kmp(s, t);
  for (int i = 1; i < s.length(); i++) {
    if (loc[i]) {
      dp[i] = (q2[i - t.length()] + i - t.length() + 1) % MOD;
    } else {
      dp[i] = dp[i - 1];
    }
    q1[i] = q1[i - 1] + dp[i];
    q2[i] = q2[i - 1] + q1[i];
    q1[i] %= MOD;
    q2[i] %= MOD;
  }
  long long res = 0;
  for (int i = 1; i < s.length(); i++) res = (res + dp[i]) % MOD;
  cout << res << endl;
  return 0;
}
