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 s[1000005], t[1000005];
int f[1000005], g[1000005], n;
int ch[1000005][26], len[1000005], fa[1000005], cnt, lst, anc[1000005],
    diff[1000005];
void init() {
  cnt = 1;
  len[1] = -1, fa[0] = fa[1] = anc[0] = 1;
}
void extend(int x, int n, char *s) {
  int p = lst, np, nq;
  while (s[n] != s[n - len[p] - 1]) p = fa[p];
  if (!ch[p][x]) {
    len[np = ++cnt] = len[p] + 2;
    nq = fa[p];
    while (s[n] != s[n - len[nq] - 1]) nq = fa[nq];
    nq = ch[nq][x];
    fa[np] = nq;
    ch[p][x] = np;
    diff[np] = len[np] - len[nq];
    anc[np] = (diff[np] == diff[nq] ? anc[nq] : nq);
  }
  lst = ch[p][x];
}
int main() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  init();
  if (n & 1) return puts("0"), 0;
  for (int i = 1, l = 1, r = n; i <= n; i++)
    if (i & 1)
      s[i] = t[l++];
    else
      s[i] = t[r--];
  g[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(s[i] - 'a', i, s);
    for (int p = lst; p; p = anc[p]) {
      f[p] = g[i - len[anc[p]] - diff[p]];
      if (anc[p] != fa[p]) (f[p] += f[fa[p]]) %= 1000000007;
      if (!(i & 1)) (g[i] += f[p]) %= 1000000007;
    }
  }
  printf("%d\n", g[n]);
}