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;
template <typename T>
inline void read(T& x) {
  char c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}
template <typename T, typename... U>
inline void read(T& x, U&... y) {
  read(x), read(y...);
}
const int N = 1e6 + 10, P = 1e9 + 7;
int n, cnt, now, last;
int fa[N], len[N], d[N], top[N], ch[N][26];
char s[N], t[N];
int F[N], G[N];
void Init() {
  cnt = 1;
  len[1] = -1;
  s[0] = '#';
  fa[0] = 1;
}
int Fail(int p) {
  while (s[now - len[p] - 1] != s[now]) p = fa[p];
  return p;
}
void Extend(int x) {
  int p = Fail(last);
  if (!ch[p][x]) {
    int np = ++cnt;
    len[np] = len[p] + 2;
    fa[np] = ch[Fail(fa[p])][x];
    d[np] = len[np] - len[fa[np]];
    top[np] = d[np] == d[fa[np]] ? top[fa[np]] : fa[np];
    ch[p][x] = np;
  }
  last = ch[p][x];
}
int main() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  if (n & 1) return puts("0"), 0;
  for (int i = 1; i <= n >> 1; ++i) s[i * 2 - 1] = t[i];
  for (int i = n; i > n >> 1; --i) s[(n - i + 1) * 2] = t[i];
  Init();
  F[0] = 1;
  for (int i = 1; i <= n; ++i) {
    now = i;
    Extend(s[i] - 'a');
    for (int p = last; p > 1; p = top[p]) {
      G[p] = F[i - len[top[p]] - d[p]];
      if (d[p] == d[fa[p]]) (G[p] += G[fa[p]]) %= P;
      if (i % 2 == 0) (F[i] += G[p]) %= P;
    }
  }
  printf("%d\n", F[n]);
  return 0;
}