#include <bits/stdc++.h>
using namespace std;
int a[100001];
int K[100001];
int mod;
int len;
int n;
string t1, t2;
vector<int> Z(string text, string pat) {
  string s = pat + '&' + text;
  int n = s.length();
  vector<int> table_Z(n);
  int L = 0, R = 0;
  for (int i = 1; i < n; i++) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R] == s[R - L]) R++;
      table_Z[i] = R - L;
      R--;
    } else {
      int k = i - L;
      if (table_Z[k] < R - i + 1)
        table_Z[i] = table_Z[k];
      else {
        L = i;
        while (R < n && s[R] == s[R - L]) R++;
        table_Z[i] = R - L;
        R--;
      }
    }
  }
  return table_Z;
}
int memo[100001][2][2][2];
int solve(int i, int start, int ok, int ok2) {
  if (i == n) {
    if (start == 0 && ok2) return 1;
    if (start != 0 && ok == 1) return 1;
    return 0;
  }
  int &ret = memo[i][start][ok][ok2];
  if (ret != -1) return ret;
  int x1 = 0, x2 = 0, x3 = 0;
  if (start == 0) {
    x1 = solve(i + 1, start, ok, ok2);
    x2 = solve(i + 1, 1, ok, ok2);
    if (K[i]) {
      x3 = solve(i + len, 1, 1, 1);
    }
    if (x3 > 0) x2 = 0;
  } else {
    x1 = solve(i + 1, start, ok, ok2);
    if (ok) {
      int x4 = 0, x5 = 0, x6 = 0;
      x4 = solve(i + 1, 0, 0, 1);
      x5 = solve(i + 1, 1, 0, 1);
      if (K[i]) {
        x6 = solve(i + len, 1, 1, 1);
      }
      if (x6 > 0) x5 = 0;
      x2 = ((x4 + x5) % mod + x6) % mod;
    }
    if (K[i]) {
      x3 = solve(i + len, 1, 1, 1);
    }
    if (x3 > 0) {
      if (ok == 0)
        x1 = 0;
      else
        x3 = 0;
    }
  }
  return ret = ((x1 + x2) % mod + x3) % mod;
}
int main() {
  mod = 1e9 + 7;
  memset(memo, -1, sizeof(memo));
  cin >> t1 >> t2;
  n = t1.length();
  vector<int> temp = Z(t1, t2);
  len = t2.length();
  int j = 0;
  for (int i = len + 1; i < temp.size(); i++) {
    if (temp[i] == len) {
      K[j] = 1;
    }
    j++;
  }
  cout << solve(0, 0, 0, 0);
}
