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 mod = 1000000007;
template <typename T>
inline void Read(T &x) {
  char c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}
const int N = 1000010;
int n, lst, cnt, f[N], g[N], h[N], anc[N], par[N], dif[N], len[N], nxt[N][26];
char s[N], p[N], q[N];
inline void Extend(int w, int n) {
  int p;
  for (p = lst; s[n] != s[n - len[p] - 1]; p = par[p])
    ;
  if (!nxt[p][w]) {
    int x = ++cnt, k = par[p];
    for (; s[n] != s[n - len[k] - 1]; k = par[k])
      ;
    len[x] = len[p] + 2, par[x] = nxt[k][w], nxt[p][w] = x,
    dif[x] = len[x] - len[par[x]],
    anc[x] = dif[x] == dif[par[x]] ? anc[par[x]] : par[x];
  }
  lst = nxt[p][w];
}
int main() {
  int i, j;
  scanf("%s", p + 1);
  n = strlen(p + 1);
  for (i = 1; i <= n; i++)
    if (i & 1)
      s[i] = p[i / 2 + 1];
    else
      s[i] = p[n - i / 2 + 1];
  lst = cnt = 1, par[0] = 1, par[1] = 0, len[1] = -1, f[0] = 1;
  s[0] = -1;
  for (int i = 1; i <= n; ++i) {
    Extend(s[i] - 'a', i);
    for (int x = lst; x; x = anc[x]) {
      g[x] = f[i - len[anc[x]] - dif[x]];
      if (anc[x] != par[x]) {
        g[x] = (g[x] + g[par[x]]) % mod;
      }
      if (!(i & 1)) {
        f[i] = (f[i] + g[x]) % mod;
      }
    }
  }
  printf("%d\n", f[n]);
  return 0;
}