#include <bits/stdc++.h>
using namespace std;
string s, t;
const int mo = 1000000007;
long long dp[100010];
long long sum[100010];
long long sumsum[100010];
unordered_map<string, int> hashtable;
int main() {
  cin >> s >> t;
  hashtable[t] = 1;
  int len = t.length();
  int i = 0;
  while (i < s.length()) {
    if (i >= len - 1 &&
        hashtable.find(s.substr(i - len + 1, len)) != hashtable.end()) {
      if (i >= len) {
        dp[i] += sumsum[i - len] + i - len + 2;
        dp[i] %= mo;
      } else {
        dp[i] = 1;
      }
    } else {
      dp[i] = dp[i - 1];
    }
    if (i > 0) {
      sum[i] = sum[i - 1] + dp[i];
      sum[i] %= mo;
      sumsum[i] = sumsum[i - 1] + sum[i];
      sumsum[i] %= mo;
    } else {
      sum[i] = dp[i];
      sumsum[i] = sum[i];
    }
    i++;
  }
  long long ans = 0;
  for (int i = 0; i < s.length(); i++) {
    ans += dp[i];
  }
  cout << ans % mo << endl;
  return 0;
}
