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 INF = 0x7fffffff;
const int N = 1e6 + 5;
inline int read() {
  int x = 0, rev = 0, ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') rev = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return rev ? -x : x;
}
int n, lst, cnt = 1, id[N], nxt[N], c[N][26], fail[N], len[N], f[N], g[N],
            diff[N];
char s[N], ss[N];
int extend(int x, int n) {
  int p = lst;
  while (s[n - len[p] - 1] != s[n]) p = fail[p];
  if (!c[p][x]) {
    int now = ++cnt, k = fail[p];
    len[now] = len[p] + 2;
    while (s[n - len[k] - 1] != s[n]) k = fail[k];
    fail[now] = c[k][x], c[p][x] = now;
    diff[now] = len[now] - len[fail[now]];
    if (diff[now] == diff[fail[now]])
      nxt[now] = nxt[fail[now]];
    else
      nxt[now] = fail[now];
  }
  return lst = c[p][x];
}
int main() {
  scanf("%s", ss + 1), n = strlen(ss + 1);
  for (int i = 1, j = 0; i <= n; i += 2) s[i] = ss[++j];
  for (int i = 2, j = n + 1; i <= n; i += 2) s[i] = ss[--j];
  fail[0] = fail[1] = 1, len[1] = -1, f[0] = 1;
  for (int i = 1; i <= n; i++) id[i] = extend(s[i] - 'a', i);
  for (int i = 1; i <= n; i++) {
    for (int j = id[i]; j; j = nxt[j]) {
      g[j] = f[i - len[nxt[j]] - diff[j]];
      if (diff[j] == diff[fail[j]]) (g[j] += g[fail[j]]) %= 1000000007;
      if (!(i & 1)) (f[i] += g[j]) %= 1000000007;
    }
  }
  printf("%d\n", f[n]);
}