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>
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-funroll-loops")
#pragma GCC target("avx,sse4")
using namespace std;
const int N = 1000005, P = 1e9 + 7;
int S[N], n, fail[N], e[N][26], len[N], ec, last, anc[N], diff[N], m, dp[N],
    val[N];
char s[N];
inline int newnode(int l) {
  len[++ec] = l;
  return ec;
}
inline void init() {
  last = 1;
  while (n) S[n--] = 0;
  S[0] = -1;
  while (~ec)
    len[ec] = fail[ec] = 0, memset(e[ec], 0, sizeof((e[ec])[0]) * (26)), ec--;
  newnode(0);
  newnode(-1);
  fail[0] = 1;
}
inline int match(int p) {
  while (S[n] != S[n - len[p] - 1]) p = fail[p];
  return p;
}
inline void extend(int c) {
  S[++n] = c;
  int cur = match(last);
  if (!e[cur][c]) {
    int p = newnode(len[cur] + 2);
    fail[p] = e[match(fail[cur])][c];
    e[cur][c] = p;
    diff[p] = len[p] - len[fail[p]];
    anc[p] = diff[p] == diff[fail[p]] ? anc[fail[p]] : fail[p];
  }
  last = e[cur][c];
}
int main() {
  scanf("%s", s + 1);
  m = strlen(s + 1);
  for (register int i = 1, _lim_ = m >> 1; i <= _lim_; i++)
    S[(i << 1) - 1] = s[i] - 'a';
  for (register int i = 1, _lim_ = m >> 1; i <= _lim_; i++)
    S[i << 1] = s[m - i + 1] - 'a';
  init();
  dp[0] = 1;
  for (register int i = 1, _lim_ = m; i <= _lim_; i++) {
    extend(S[i]);
    for (int x = last; x; x = anc[x]) {
      if (anc[x] != fail[x])
        val[x] = val[fail[x]];
      else
        val[x] = 0;
      int p = i - len[anc[x]] - diff[x];
      val[x] = (val[x] + dp[p]) % P;
      if ((~i & 1)) dp[i] = (dp[i] + val[x]) % P;
    }
  }
  printf("%d\n", dp[m]);
  return 0;
}