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;
int n, f[1000005], g[1000005];
char S[1000005], T[1000005];
int rt0, rt1, ch[1000005][26];
int cnt = 1, lst, len[1000005], dif[1000005], lnk[1000005], slk[1000005];
void Extend(int p) {
  int w = lst;
  while (T[p - len[w] - 1] != T[p]) w = lnk[w];
  if (!ch[w][T[p] - 'a']) {
    int cur = ++cnt, k = lnk[w];
    len[cur] = len[w] + 2;
    while (T[p - len[k] - 1] != T[p]) k = lnk[k];
    lnk[cur] = ch[k][T[p] - 'a'];
    ch[w][T[p] - 'a'] = cur;
    dif[cur] = len[cur] - len[lnk[cur]];
    if (dif[cur] == dif[lnk[cur]])
      slk[cur] = slk[lnk[cur]];
    else
      slk[cur] = lnk[cur];
  }
  lst = ch[w][T[p] - 'a'];
}
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  for (int i = 1; i <= n / 2; i++) T[2 * i - 1] = S[i];
  for (int i = n; i > n / 2; i--) T[2 * (n - i + 1)] = S[i];
  len[1] = -1;
  lnk[0] = lnk[1] = 1;
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    Extend(i);
    for (int j = lst; j; j = slk[j]) {
      g[j] = f[i - (len[slk[j]] + dif[j])];
      if (dif[j] == dif[lnk[j]]) g[j] = (g[j] + g[lnk[j]]) % 1000000007;
      if (!(i & 1)) f[i] = (f[i] + g[j]) % 1000000007;
    }
  }
  printf("%d\n", f[n]);
}