One day Polycarpus got hold of two non-empty strings s and t, consisting of lowercase Latin letters. Polycarpus is quite good with strings, so he immediately wondered, how many different pairs of "x y" are there, such that x is a substring of string s, y is a subsequence of string t, and the content of x and y is the same. Two pairs are considered different, if they contain different substrings of string s or different subsequences of string t. Read the whole statement to understand the definition of different substrings and subsequences.

The length of string s is the number of characters in it. If we denote the length of the string s as |s|, we can write the string as s = s1s2... s|s|.

A substring of s is a non-empty string x = s[a... b] = sasa + 1... sb (1 ≤ a ≤ b ≤ |s|). For example, "code" and "force" are substrings or "codeforces", while "coders" is not. Two substrings s[a... b] and s[c... d] are considered to be different if a ≠ c or b ≠ d. For example, if s="codeforces", s[2...2] and s[6...6] are different, though their content is the same.

A subsequence of s is a non-empty string y = s[p1p2... p|y|] = sp1sp2... sp|y| (1 ≤ p1 < p2 < ... < p|y| ≤ |s|). For example, "coders" is a subsequence of "codeforces". Two subsequences u = s[p1p2... p|u|] and v = s[q1q2... q|v|] are considered different if the sequences p and q are different.

Input

The input consists of two lines. The first of them contains s (1 ≤ |s| ≤ 5000), and the second one contains t (1 ≤ |t| ≤ 5000). Both strings consist of lowercase Latin letters.

Output

Print a single number — the number of different pairs "x y" such that x is a substring of string s, y is a subsequence of string t, and the content of x and y is the same. As the answer can be rather large, print it modulo 1000000007 (109 + 7).

Examples

Input

aa
aa


Output

5


Input

codeforces
forceofcode


Output

60

Note

Let's write down all pairs "x y" that form the answer in the first sample: "s[1...1] t[1]", "s[2...2] t[1]", "s[1...1] t[2]","s[2...2] t[2]", "s[1...2] t[1 2]".
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
#pragma hdrstop
using namespace std;
inline void sIO() {}
inline void iIO() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
inline void fIO(string fn) {
  freopen((fn + ".in").c_str(), "r", stdin);
  freopen((fn + ".out").c_str(), "w", stdout);
}
inline void TM() {}
inline void swap(short& a, short& b) { b ^= a ^= b ^= a; }
inline void swap(int& a, int& b) { b ^= a ^= b ^= a; }
inline void swap(char& a, char& b) { b ^= a ^= b ^= a; }
inline void swap(long long& a, long long& b) { b ^= a ^= b ^= a; }
template <class T>
inline T abs(T x) {
  return x < 0 ? -x : x;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T min(T& a, T& b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T& a, T& b) {
  return a > b ? a : b;
}
template <class T>
inline T gcd(T a, T b) {
  if (a < b) swap(a, b);
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
inline bool isPrime(T n) {
  if (n < 2) return false;
  T kk = (T)sqrt(n + 0.);
  for (T i = 2; i <= kk; ++i)
    if (!(n % i)) return false;
  return true;
}
template <class T>
inline string toa(T x) {
  stringstream ss;
  ss << x;
  string ret;
  ss >> ret;
  return ret;
}
template <class T>
inline T ppow(T a, long long b) {
  T ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    b >>= 1;
  }
  return ret;
}
template <class T>
inline T ppow(T a, long long b, long long md) {
  T ret = 1;
  a %= md;
  while (b) {
    if (b & 1) ret = ret * a % md;
    a = a * a % md;
    b >>= 1;
  }
  return ret % md;
}
inline int toi(string s) {
  stringstream ss;
  ss << s;
  int ret;
  ss >> ret;
  return ret;
}
inline long long tol(string s) {
  stringstream ss;
  ss << s;
  long long ret;
  ss >> ret;
  return ret;
}
inline int Random() { return ((rand() << 16) | rand()); }
inline char upperCase(char ch) {
  return (ch >= 'a' && ch <= 'z') ? ch ^ 32 : ch;
}
inline char lowerCase(char ch) {
  return (ch >= 'A' && ch <= 'Z') ? ch ^ 32 : ch;
}
inline string upperCase(string s) {
  int ls = s.length();
  for (int i = 0; i < ls; ++i)
    if (s[i] >= 'a' && s[i] <= 'z') s[i] ^= 32;
  return s;
}
inline string lowerCase(string s) {
  int ls = s.length();
  for (int i = 0; i < ls; ++i)
    if (s[i] >= 'A' && s[i] <= 'Z') s[i] ^= 32;
  return s;
}
inline int dig(char ch) { return ch - 48; }
inline bool isAlpha(char ch) {
  return (ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z');
}
inline bool isDigit(char ch) { return (ch >= '0' && ch <= '9'); }
inline bool isLowerCase(char ch) { return (ch >= 'a' && ch <= 'z'); }
inline bool isUpperCase(char ch) { return (ch >= 'A' && ch <= 'Z'); }
int __;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
const int MD = 1000000007;
char s[5555], t[5555];
int d[5555][5555], ans, ls, lt;
int main() {
  sIO();
  memset(d, 0, sizeof(d));
  gets(s);
  gets(t);
  ls = strlen(s);
  lt = strlen(t);
  for (int i = ls; i > 0; --i)
    for (int j = lt; j > 0; --j) {
      d[i][j] = d[i][j + 1];
      if (s[i - 1] == t[j - 1]) d[i][j] += d[i + 1][j + 1] + 1;
      if (d[i][j] > MD) d[i][j] -= MD;
    }
  ans = 0;
  for (int i = 1; i <= ls; ++i) {
    ans += d[i][1];
    if (ans > MD) ans -= MD;
  }
  printf("%d", ans);
  return 0;
}
