Problem: Given a string s, find the number of ways to split s to substrings such that if there are k substrings (p1, p2, p3, ..., pk) in partition, then pi = pk - i + 1 for all i (1 ≤ i ≤ k) and k is even.

Since the number of ways can be large, print it modulo 109 + 7.

Input

The only line of input contains a string s (2 ≤ |s| ≤ 106) of even length consisting of lowercase Latin letters. 

Output

Print one integer, the number of ways of partitioning the string modulo 109 + 7.

Examples

Input

abcdcdab


Output

1

Input

abbababababbab


Output

3

Note

In the first case, the only way to partition the string is ab|cd|cd|ab.

In the second case, the string can be partitioned as ab|b|ab|ab|ab|ab|b|ab or ab|b|abab|abab|b|ab or abbab|ab|ab|abbab.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
char S[1000000 + 5], T[1000000 + 5];
int c[1000000 + 5][26], l[1000000 + 5], f[1000000 + 5], tn, df[1000000 + 5],
    ff[1000000 + 5], s[1000000 + 5], F[1000000 + 5];
int main() {
  int n, i, j, x;
  scanf("%s", S + 1);
  n = strlen(S + 1);
  T[0] = 255;
  for (i = 1; i <= n / 2; ++i)
    T[2 * i - 1] = S[i] - 'a', T[2 * i] = S[n - i + 1] - 'a';
  f[0] = 1;
  l[++tn] = -1;
  for (F[0] = i = x = 1; i <= n; ++i) {
    while (T[i] != T[i - l[x] - 1]) x = f[x];
    if (!c[x][T[i]]) {
      for (j = f[x]; T[i - l[j] - 1] != T[i]; j = f[j])
        ;
      f[++tn] = c[j][T[i]];
      l[c[x][T[i]] = tn] = l[x] + 2;
      df[tn] = l[tn] - l[f[tn]];
      ff[tn] = df[tn] == df[f[tn]] ? ff[f[tn]] : tn;
    }
    x = c[x][T[i]];
    for (j = x; j; j = f[ff[j]]) {
      s[j] = F[i - l[ff[j]]];
      if (ff[j] != j) s[j] = (s[j] + s[f[j]]) % 1000000007;
      if (~i & 1) F[i] = (F[i] + s[j]) % 1000000007;
    }
  }
  printf("%d", F[n]);
}