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>
using namespace std;
char ch[1000010], Ch[1000010];
int n;
long long F[1000010], S[1000010];
int C[1000010][26], Pr[1000010], Sz[1000010], D[1000010], Pl[1000010],
    cnt = 1, l = 1, tot = 0;
int getp(int x) {
  for (; Ch[tot - Sz[x] - 1] != Ch[tot]; x = Pr[x])
    ;
  return x;
}
void add(int x, int b) {
  Ch[++tot] = x;
  l = getp(l);
  if (C[l][x])
    l = C[l][x];
  else {
    Sz[++cnt] = Sz[l] + 2;
    Pr[cnt] = C[getp(Pr[l])][x];
    l = (C[l][x] = cnt);
    D[l] = Sz[l] - Sz[Pr[l]];
  }
  for (int i = l; i; i = Pl[i]) {
    if (D[i] == D[Pr[i]]) {
      Pl[i] = Pl[Pr[i]];
      S[i] = (F[tot - Sz[Pl[i]] - D[i]] + S[Pr[i]]) % 1000000007;
    } else {
      Pl[i] = Pr[i];
      S[i] = F[tot - Sz[Pl[i]] - D[i]];
    }
    if (b) F[tot] = (F[tot] + S[i]) % 1000000007;
  }
}
int main() {
  Ch[0] = 123;
  scanf("%s", ch);
  n = strlen(ch);
  Pr[0] = 1;
  Sz[1] = -1;
  F[0] = 1;
  for (int i = 0; i < n / 2; i++) {
    add(ch[i] - 'a', 0);
    add(ch[n - i - 1] - 'a', 1);
  }
  printf("%lld\n", (F[n] % 1000000007 + 1000000007) % 1000000007);
  return 0;
}