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;
const int mo = 1000000007;
const int N = 1000005;
int ch[N][26];
int nd, la, fa[N], l[N];
int dif[N], anc[N];
int f[N], g[N], n;
char ss[N], s[N];
void init() {
  nd = 1;
  l[1] = -1;
  fa[0] = fa[1] = 1;
  anc[0] = 1;
}
void extend(int c, int n) {
  int p = la;
  for (; s[n - l[p] - 1] != s[n]; p = fa[p])
    ;
  if (!ch[p][c]) {
    int np = ++nd, x = fa[p];
    for (; s[n - l[x] - 1] != s[n]; x = fa[x])
      ;
    l[np] = l[p] + 2;
    fa[np] = ch[x][c];
    dif[np] = l[np] - l[fa[np]];
    ch[p][c] = np;
    anc[np] = (dif[np] == dif[fa[np]] ? anc[fa[np]] : fa[np]);
  }
  la = ch[p][c];
}
int main() {
  init();
  scanf("%s", ss + 1);
  n = strlen(ss + 1);
  assert(n % 2 == 0);
  for (int i = (int)(1); i <= (int)(n / 2); i++) s[i * 2 - 1] = ss[i];
  for (int i = (int)(1); i <= (int)(n / 2); i++) s[i * 2] = ss[n - i + 1];
  g[0] = 1;
  for (int i = (int)(1); i <= (int)(n); i++) {
    extend(s[i] - 'a', i);
    for (int j = la; j > 1; j = anc[j]) {
      f[j] = g[i - l[anc[j]] - dif[j]];
      if (anc[j] != fa[j]) f[j] = (f[j] + f[fa[j]]) % mo;
      if (i % 2 == 0) g[i] = (g[i] + f[j]) % mo;
    }
  }
  printf("%d\n", g[n]);
}