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;
template <class T>
inline T Tmin(const T &lch, const T &rch) {
  if (lch < rch) return lch;
  return rch;
}
template <class T>
inline T Tmax(const T &lch, const T &rch) {
  if (lch < rch) return rch;
  return lch;
}
const int Inf = 0x3f3f3f3f;
const int Mod = 1e9 + 7;
const int Gp = 3;
inline int R_int() {
  register int n = 0;
  register char ch = getchar();
  register bool I = false;
  while (ch < '0' || ch > '9') I = (ch == '-' ? 1 : 0), ch = getchar();
  while (ch >= '0' && ch <= '9')
    n = (n << 1) + (n << 3) + (ch ^ '0'), ch = getchar();
  return I ? -n : n;
}
inline int Add(int a, int b) {
  int ans = (a + b);
  ans = (ans >= Mod ? ans - Mod : ans);
  return ans;
}
inline int Mis(int a, int b) {
  int ans = a - b;
  ans = (ans < 0 ? ans + Mod : ans);
  return ans;
}
inline int Mul(int a, int b) { return a * 1ll * b % Mod; }
inline int Pow(int a, long long k) {
  int ans = 1;
  while (k) {
    if (k & 1) ans = Mul(ans, a);
    a = Mul(a, a);
    k = k >> 1;
  }
  return ans;
}
const int maxn = 1000000 + 10;
char str[maxn];
char ss[maxn];
int f[maxn];
int g[maxn];
int n, m;
namespace PAM {
int ch[maxn][26];
int fail[maxn];
int size[maxn];
int dif[maxn];
int len[maxn];
int pos[maxn];
int c[maxn];
int last;
int tot;
int n;
inline void PAM() {
  n = 0;
  c[0] = -1;
  tot = last = 1;
  fail[0] = fail[1] = 1;
  len[0] = 0;
  len[1] = -1;
}
inline void Insert(int x) {
  int p = last;
  c[++n] = x;
  while (c[n - len[p] - 1] ^ x) p = fail[p];
  if (!ch[p][x]) {
    int np = ++tot, q = fail[p];
    len[np] = len[p] + 2;
    while (c[n - len[q] - 1] ^ x) q = fail[q];
    fail[np] = ch[q][x];
    ch[p][x] = np;
    dif[np] = len[np] - len[fail[np]];
    pos[np] = (dif[np] == dif[fail[np]]) ? pos[fail[np]] : fail[np];
  }
  size[last = ch[p][x]]++;
}
}  // namespace PAM
signed main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  if (n & 1) return !puts("0");
  for (int i = 1; i <= n; i += 2)
    ss[i] = str[(i + 1) >> 1], ss[i + 1] = str[n - (i >> 1)];
  PAM::PAM();
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    PAM::Insert(ss[i] - 'a');
    for (int x = PAM::last; x; x = PAM::pos[x]) {
      g[x] = f[i - PAM::len[PAM::pos[x]] - PAM::dif[x]];
      if (PAM::pos[x] != PAM::fail[x]) g[x] = Add(g[x], g[PAM::fail[x]]);
      if (!(i & 1)) f[i] = Add(f[i], g[x]);
    }
  }
  printf("%d\n", f[n]);
  return 0;
}