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 = 1e6 + 10;
const int mod = 1e9 + 7;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
char t[N];
int n, m = 0, s[N], ch[N][26], fa[N], len[N], diff[N], anc[N], tot = 0, p = 0,
       f[N], g[N];
void extend(int n, int c) {
  while (s[n] != s[n - len[p] - 1]) p = fa[p];
  if (!ch[p][c]) {
    int q = ++tot;
    len[q] = len[p] + 2;
    int v = fa[p];
    while (s[n] != s[n - len[v] - 1]) v = fa[v];
    fa[q] = ch[v][c];
    ch[p][c] = q;
    diff[q] = len[q] - len[fa[q]],
    anc[q] = diff[q] == diff[fa[q]] ? anc[fa[q]] : fa[q];
  }
  p = ch[p][c];
}
int main() {
  scanf("%s", t + 1), n = strlen(t + 1);
  for (int i = 1; i <= n / 2; i++)
    s[++m] = t[i] - 'a', s[++m] = t[n - i + 1] - 'a';
  s[0] = -1, s[n + 1] = -2;
  len[++tot] = -1, fa[0] = fa[1] = 1;
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(i, s[i]);
    for (int v = p; v; v = anc[v]) {
      g[v] = f[i - len[anc[v]] - diff[v]];
      if (fa[v] != anc[v]) g[v] = (g[v] + g[fa[v]]) % mod;
      if (!(i & 1)) f[i] = (f[i] + g[v]) % mod;
    }
  }
  printf("%d\n", f[n]);
  return 0;
}