Hamed has recently found a string *t* and suddenly became quite fond of it. He spent several days trying to find all occurrences of *t* in other strings he had. Finally he became tired and started thinking about the following problem. Given a string *s* how many ways are there to extract *k* ≥ 1 non-overlapping substrings from it such that each of them contains string *t* as a substring? More formally, you need to calculate the number of ways to choose two sequences *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*k*</sub> and *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*k*</sub> satisfying the following requirements:
 -  *k* ≥ 1 -  <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/9787d50d9b7a3b6baffe4cb496df2248b003b17a.png" style="max-width: 100.0%;max-height: 100.0%;"/> -  <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/092ce460b67857d1ad157982f2234fb864faae89.png" style="max-width: 100.0%;max-height: 100.0%;"/> -  <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/c25caac60742ab6bf606b781e3f62be37a796eeb.png" style="max-width: 100.0%;max-height: 100.0%;"/> -  <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/99ce7829f1cda3a108cb995b136005e31e6f5582.png" style="max-width: 100.0%;max-height: 100.0%;"/>  *t* is a substring of string *s*<sub class="lower-index">*a*<sub class="lower-index">*i*</sub></sub>*s*<sub class="lower-index">*a*<sub class="lower-index">*i*</sub> + 1</sub>... *s*<sub class="lower-index">*b*<sub class="lower-index">*i*</sub></sub> (string *s* is considered as 1-indexed). 
As the number of ways can be rather large print it modulo 10<sup class="upper-index">9</sup> + 7.
Input consists of two lines containing strings *s* and *t* (1 ≤ |*s*|, |*t*| ≤ 10<sup class="upper-index">5</sup>). Each string consists of lowercase Latin letters.
#!/usr/bin/env python
# coding=utf-8

s, t = input(), input()
n, m = len(s), len(t)
t = '$'.join((t, s))
p = [0]
k = 0
for i in range(1, n + m + 1):
    while k and t[k] != t[i]:
        k = p[k - 1]
    if t[k] == t[i]:
        k += 1
    p.append(k)
ans = [0] * n
sums = [0] * (n + 1)
curs = 0
was = False
j = 0
mod = 1000000007
for i in range(n):
    if p[i + m + 1] == m:
        if not was:
            was = True
            curs = 1
        while j <= i - m:
            curs = (curs + sums[j] + 1) % mod
            j += 1
    ans[i]=  curs;
    sums[i] = (sums[i - 1] + ans[i]) % mod;
print(sum(ans) % mod)
