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 N(1000010), MOD(1e9 + 7);
int n, cn1(1), las;
int len[N], fail[N], f[N], son[N][26], dif[N], top[N], g[N];
char s[N], t[N];
inline int read() {
  register int x(0), t(1);
  register char ch(getchar());
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + (ch ^ '0'), ch = getchar();
  return x * t;
}
inline void ins(register int x, register int i) {
  while (s[i - len[las] - 1] != s[i]) las = fail[las];
  if (!son[las][x]) {
    len[++cn1] = len[las] + 2;
    register int q(fail[las]);
    while (s[i - len[q] - 1] != s[i]) q = fail[q];
    fail[cn1] = son[q][x];
    dif[cn1] = len[cn1] - len[fail[cn1]];
    top[cn1] = dif[cn1] == dif[fail[cn1]] ? top[fail[cn1]] : fail[cn1];
    son[las][x] = cn1;
  }
  las = son[las][x];
}
int main() {
  register int i, j;
  scanf("%s", t + 1);
  n = strlen(t + 1);
  if (n & 1) {
    puts("0");
    return 0;
  }
  for (i = 1; i <= n / 2; ++i) {
    s[(i << 1) - 1] = t[i];
    s[i << 1] = t[n - i + 1];
  }
  len[fail[0] = g[0] = 1] = -1;
  for (i = 1; i <= n; ++i) {
    ins(s[i] - 'a', i);
    for (j = las; j; j = top[j]) {
      f[j] = g[i - len[top[j]] - dif[j]];
      if (top[j] != fail[j]) {
        f[j] += f[fail[j]];
        if (f[j] >= MOD) f[j] -= MOD;
      }
      if (!(i & 1)) {
        g[i] += f[j];
        if (g[i] >= MOD) g[i] -= MOD;
      }
    }
  }
  printf("%d\n", g[n]);
  return 0;
}