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, P = 1e9 + 7;
int n, cnt, pos[N], len[N], dis[N], fa[N], top[N], ch[N][26];
char t[N], s[N];
int f[N], ans[N];
int jump(int x, int p) {
  while (s[p - len[x] - 1] != s[p]) x = fa[x];
  return x;
}
int Insert(int x, int p) {
  x = jump(x, p);
  int c = s[p] - 'a';
  if (!ch[x][c]) {
    ++cnt;
    len[cnt] = len[x] + 2;
    int y = jump(fa[x], p);
    fa[cnt] = ch[y][c];
    y = cnt;
    dis[y] = len[y] - len[fa[y]];
    if (dis[y] != dis[fa[y]])
      top[y] = y;
    else
      top[y] = top[fa[y]];
    ch[x][c] = y;
  }
  return ch[x][c];
}
int main() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  if (n & 1) return puts("0") & 0;
  for (int i = 1; i <= n; i += 2) s[i] = t[i / 2 + 1];
  for (int i = 2; i <= n; i += 2) s[i] = t[n - i / 2 + 1];
  len[1] = -1;
  fa[0] = top[1] = cnt = 1;
  for (int i = 1; i <= n; i++) pos[i] = Insert(pos[i - 1], i);
  ans[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int x = pos[i]; x; x = fa[top[x]]) {
      f[x] = ans[i - len[top[x]]];
      if (x != top[x]) (f[x] += f[fa[x]]) %= P;
      if (!(i & 1)) (ans[i] += f[x]) %= P;
    }
  }
  printf("%d\n", ans[n]);
  return 0;
}