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;
inline int readint() {
  int a = 0;
  char c = getchar(), f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (; '0' <= c && c <= '9'; c = getchar())
    a = (a << 3) + (a << 1) + (c ^ 48);
  return a * f;
}
const int MaxN = 1000005;
const int CharSiz = 26;
const int Mod = 1e9 + 7;
int f[MaxN], g[MaxN];
char s[MaxN] = {-1};
namespace PAM {
int ch[MaxN][CharSiz];
int fail[MaxN] = {1, 1};
int len[MaxN] = {0, -1};
int lst = 1, cntNode = 1;
int top[MaxN] = {0, 1};
void add(int n) {
  int p = lst;
  while (s[n - len[p] - 1] != s[n]) p = fail[p];
  int now = ch[p][s[n] - 'a'];
  if (now == 0) {
    now = ++cntNode;
    len[now] = len[p] + 2;
    fail[now] = fail[p];
    while (s[n - len[fail[now]] - 1] != s[n]) fail[now] = fail[fail[now]];
    fail[now] = ch[fail[now]][s[n] - 'a'];
    ch[p][s[n] - 'a'] = now;
    if ((len[fail[now]] << 1) == len[now] + len[fail[fail[now]]])
      top[now] = top[fail[now]];
    else
      top[now] = fail[now];
  }
  lst = now;
}
int maintain(int n) {
  int res = 0;
  for (int p = lst; p && p != 1; p = top[p]) {
    int dif = len[p] - len[fail[p]];
    g[p] = f[n - len[top[p]] - dif];
    if (top[p] != fail[p]) g[p] = (g[p] + g[fail[p]]) % Mod;
    res = (res + g[p]) % Mod;
  }
  return (n & 1) ? 0 : res;
}
}  // namespace PAM
char sy[MaxN];
int main() {
  scanf("%s", sy);
  int n = strlen(sy);
  for (int i = 0; (i << 1) < n; ++i) s[2 * i + 1] = sy[i];
  for (int i = n - 1; 2 * (n - i) <= n; --i) s[2 * (n - i)] = sy[i];
  f[0] = 1;
  for (int i = 1; i <= n; ++i) {
    PAM::add(i);
    f[i] = PAM::maintain(i);
  }
  printf("%d\n", f[n]);
  return 0;
}