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 P = 1000000007;
const int N = 1010000;
int fail[N];
int go[N][26], len[N], diff[N], anc[N], lst;
int n;
char str[N];
int p;
int s[N];
int f[N], g[N];
void addChar(int c, int ww) {
  int x = lst;
  while (s[ww] != s[ww - len[x] - 1]) {
    x = fail[x];
  }
  if (!go[x][c]) {
    len[p] = len[x] + 2;
    int k = fail[x];
    while (s[ww] != s[ww - len[k] - 1]) k = fail[k];
    fail[p] = go[k][c];
    go[x][c] = p;
    diff[p] = len[p] - len[fail[p]];
    if (diff[p] == diff[fail[p]])
      anc[p] = anc[fail[p]];
    else
      anc[p] = fail[p];
    p++;
  }
  lst = go[x][c];
}
void init() {
  p = 2;
  len[0] = 0;
  len[1] = -1;
  fail[0] = 1;
  fail[1] = 0;
  f[0] = 1;
  lst = 1;
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  if (n & 1) {
    printf("0\n");
    return 0;
  }
  for (int i = (int)1; i <= (int)n / 2; i++) {
    s[i * 2 - 1] = str[i] - 'a';
    s[i * 2] = str[n + 1 - i] - 'a';
  }
  s[0] = -1;
  init();
  for (int i = (int)1; i <= (int)n; i++) {
    addChar(s[i], i);
    for (int x = lst; x; x = anc[x]) {
      g[x] = f[i - (len[anc[x]] + diff[x])];
      if (anc[x] != fail[x]) {
        g[x] = (g[x] + g[fail[x]]) % P;
      }
      if (i % 2 == 0) f[i] = (f[i] + g[x]) % P;
    }
  }
  printf("%d\n", f[n]);
  return 0;
}