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>
const int P = 1000000007;
inline int mul(const int &a, const int &b) { return 1ll * a * b % P; }
inline int add(int a, const int &b) {
  a += b;
  return (a >= P) ? a - P : a;
}
inline int sub(int a, const int &b) {
  a -= b;
  return (a < 0) ? a + P : a;
}
int n, s[1000001], son[1000001][26], fail[1000001],
    cnt = 1, last = 1, len[1000001], pos[1000001], f[1000001], dif[1000001],
    an[1000001], g[1000001];
char tem[1000001];
int get_fail(int x) {
  while (s[n - len[x] - 1] != s[n]) x = fail[x];
  return x;
}
void add(int x) {
  s[++n] = x;
  int p = get_fail(last);
  if (!son[p][x]) {
    len[++cnt] = len[p] + 2;
    fail[cnt] = son[get_fail(fail[p])][x];
    son[p][x] = cnt;
    dif[cnt] = len[cnt] - len[fail[cnt]];
    an[cnt] = (dif[cnt] == dif[fail[cnt]]) ? an[fail[cnt]] : fail[cnt];
  }
  last = son[p][x];
}
int main() {
  scanf("%s", tem + 1);
  int nl = strlen(tem + 1);
  len[1] = s[0] = -1;
  fail[0] = 1;
  f[0] = 1;
  for (int i = 1; i <= nl; i++) {
    add(tem[i % 2 == 1 ? (i + 1) >> 1 : (nl - (i >> 1) + 1)] - 'a');
    for (int j = last; j; j = an[j]) {
      int tem = 0;
      g[j] =
          add((an[j] == fail[j]) ? 0 : g[fail[j]], f[i - len[an[j]] - dif[j]]);
      f[i] = add(f[i], g[j]);
    }
    if (i % 2) f[i] = 0;
  }
  printf("%d\n", f[nl]);
}