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 = 1000005;
const int p = 1e9 + 7;
int l, t, num, lst, a[N], len[N], fail[N], dif[N], g[N], f[N], ans[N],
    tr[N][28];
char s[N];
inline int get_fail(int x, int y) {
  while (a[x] ^ a[x - len[y] - 1]) y = fail[y];
  return y;
}
inline int inc(int x, int y) {
  x += y;
  return x < p ? x : x - p;
}
int main() {
  scanf("%s", s + 1), l = strlen(s + 1);
  if (l & 1) {
    putchar(48);
    return 0;
  }
  t = l >> 1, len[1] = a[0] = -1, fail[0] = ans[0] = num = 1;
  for (register int i = 1; i <= t; ++i) a[(i << 1) - 1] = s[i] - 97;
  for (register int i = l; i > t; --i) a[(l - i + 1) << 1] = s[i] - 97;
  for (register int i = 1; i <= l; ++i) {
    int u = a[i], v = get_fail(i, lst);
    if (!tr[v][u]) {
      fail[++num] = tr[get_fail(i, fail[v])][u],
      len[tr[v][u] = num] = len[v] + 2, dif[num] = len[num] - len[fail[num]];
      if (dif[num] == dif[fail[num]])
        g[num] = g[fail[num]];
      else
        g[num] = fail[num];
    }
    for (register int j = lst = tr[v][u]; j; j = g[j]) {
      f[j] = ans[i - len[g[j]] - dif[j]];
      if (g[j] ^ fail[j]) f[j] = inc(f[j], f[fail[j]]);
      if (!(i & 1)) ans[i] = inc(ans[i], f[j]);
    }
  }
  printf("%d", ans[l]);
  return 0;
}