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>
template <class T>
inline bool cmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
inline bool cmin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
using namespace std;
const int N = 1e6 + 5, P = 1e9 + 7;
typedef int arr[N];
struct PAM {
  int n, T, las, ch[N][26];
  char s[N];
  arr fa, len, gp, d;
  inline void init() {
    las = n = 0;
    T = fa[0] = 1, s[0] = len[1] = -1;
  }
  inline int gf(int x) {
    while (s[n - len[x] - 1] ^ s[n]) x = fa[x];
    return x;
  }
  inline void ins(int v) {
    s[++n] = v;
    las = gf(las);
    if (!ch[las][v]) {
      fa[++T] = ch[gf(fa[las])][v], len[T] = len[las] + 2;
      d[T] = len[T] - len[fa[T]];
      ch[las][v] = T;
      gp[T] = d[T] == d[fa[T]] ? gp[fa[T]] : fa[T];
    }
    las = ch[las][v];
  }
} p;
int n;
arr f, g;
char s[N], ch[N];
inline int add(int a, int b) { return a += b, a >= P ? a - P : a; }
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  f[0] = 1;
  if (n & 1) return puts("0"), 0;
  p.init();
  for (int i = 1; i <= n; i += 2) ch[i] = s[(i >> 1) + 1];
  for (int i = 2; i <= n; i += 2) ch[i] = s[n - (i >> 1) + 1];
  for (register int i = 1, I = n + 1; i < I; ++i) {
    p.ins(ch[i] - 'a');
    for (int j = p.las; j; j = p.gp[j]) {
      g[j] = f[i - p.len[p.gp[j]] - p.d[j]];
      if (p.gp[j] ^ p.fa[j]) g[j] = add(g[j], g[p.fa[j]]);
      if (~i & 1) f[i] = add(f[i], g[j]);
    }
  }
  printf("%d", f[n]);
  return 0;
}