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 comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int inf = 0x3f3f3f3f;
inline long long read() {
  register long long x = 0, f = 1;
  register char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x * f;
}
void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  puts("");
}
const int maxn = 1e6 + 233;
const int mod = 1e9 + 7;
int ans = 0, n;
char s[maxn], ss[maxn];
int len[maxn], fail[maxn], tot, last, L[maxn];
int anc[maxn], f[maxn], g[maxn], dif[maxn];
int first[maxn], tote, nxtv[maxn], nxtx[maxn], nxtp[maxn];
inline void init() {
  s[0] = '#';
  len[0] = 0;
  len[1] = -1;
  fail[0] = fail[1] = 1;
  tot = 1, last = 0;
  memset(first, -1, sizeof(first));
  tote = 0;
}
inline void add(int x, int v, int to) {
  nxtv[tote] = v;
  nxtp[tote] = first[x];
  nxtx[tote] = to;
  first[x] = tote++;
}
inline int find(int x, int v) {
  for (int e = first[x]; ~e; e = nxtp[e])
    if (nxtv[e] == v) return nxtx[e];
  return 0;
}
inline int gfail(int x, int pos) {
  while (s[pos - len[x] - 1] != s[pos]) x = fail[x];
  return x;
}
void extend(int x) {
  last = gfail(last, x);
  if (!find(last, s[x])) {
    ++tot;
    len[tot] = len[last] + 2;
    int j = gfail(fail[last], x);
    fail[tot] = find(j, s[x]);
    dif[tot] = len[tot] - len[fail[tot]];
    anc[tot] = fail[tot];
    if (dif[tot] == dif[fail[tot]]) anc[tot] = anc[fail[tot]];
    add(last, s[x], tot);
  }
  last = find(last, s[x]);
}
int main() {
  scanf("%s", ss + 1);
  n = strlen(ss + 1);
  if (n & 1) return puts("0"), 0;
  for (register int i = (1); i <= int(n / 2); ++i) {
    s[i * 2 - 1] = ss[i] - 'a';
    s[i * 2] = ss[n - i + 1] - 'a';
  }
  init();
  f[0] = 1;
  for (register int i = (1); i <= int(n); ++i) {
    extend(i);
    for (int x = last; x; x = anc[x]) {
      if (dif[x] == dif[fail[x]]) {
        g[x] = f[i - (len[anc[x]] + dif[x])];
        g[x] = (g[x] + g[fail[x]]) % mod;
      } else {
        g[x] = f[i - (len[anc[x]] + dif[x])];
      }
      if (i % 2 == 0) f[i] = (f[i] + g[x]) % mod;
    }
  }
  writeln(f[n]);
  return 0;
}