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 maxn = 2000010;
const int mod = 1e9 + 7;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);
template <typename T>
inline void read(T &x) {
  x = 0;
  T f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do x = x * 10 + ch - '0', ch = getchar();
  while (ch <= '9' && ch >= '0');
  x *= f;
}
template <typename A, typename B>
inline void read(A &x, B &y) {
  read(x);
  read(y);
}
template <typename A, typename B, typename C>
inline void read(A &x, B &y, C &z) {
  read(x);
  read(y);
  read(z);
}
template <typename A, typename B, typename C, typename D>
inline void read(A &x, B &y, C &z, D &w) {
  read(x);
  read(y);
  read(z);
  read(w);
}
template <typename A, typename B>
inline A fexp(A x, B p) {
  A ans = 1;
  for (; p; p >>= 1, x = 1LL * x * x % mod)
    if (p & 1) ans = 1LL * ans * x % mod;
  return ans;
}
template <typename A, typename B>
inline A fexp(A x, B p, A mo) {
  A ans = 1;
  for (; p; p >>= 1, x = 1LL * x * x % mo)
    if (p & 1) ans = 1LL * ans * x % mo;
  return ans;
}
int n, cnt, lst;
char st[maxn], s[maxn];
int f[maxn], fa[maxn], len[maxn], anc[maxn], dif[maxn], nxt[maxn][26], sm[maxn];
void extend(int c, int n) {
  int cur = lst;
  while (s[n - len[cur] - 1] != s[n]) cur = fa[cur];
  if (!nxt[cur][c]) {
    int x = ++cnt, k = fa[cur];
    len[x] = len[cur] + 2;
    for (; s[n] != s[n - len[k] - 1]; k = fa[k])
      ;
    fa[x] = nxt[k][c];
    nxt[cur][c] = x;
    dif[x] = len[x] - len[fa[x]];
    anc[x] = dif[x] == dif[fa[x]] ? anc[fa[x]] : fa[x];
  }
  lst = nxt[cur][c];
}
void Work() {
  f[0] = 1;
  lst = cnt = 1, fa[0] = 1, fa[1] = 0, len[1] = -1;
  for (int i = (1); i <= (n); i++) {
    extend(s[i] - 'a', i);
    for (int x = lst; x; x = anc[x]) {
      sm[x] = f[i - len[anc[x]] - dif[x]];
      if (anc[x] != fa[x]) sm[x] = (sm[x] + sm[fa[x]]) % mod;
      if (i % 2 == 0) f[i] = (f[i] + sm[x]) % mod;
    }
  }
  printf("%d\n", f[n]);
}
void Init() {
  scanf("%s", st + 1);
  n = strlen(st + 1);
  if (n & 1) {
    puts("0");
    exit(0);
  }
  for (int i = (1); i <= (n); i++)
    if (i & 1)
      s[i] = st[(i + 1) >> 1];
    else
      s[i] = st[n - i / 2 + 1];
}
int main() {
  Init();
  Work();
  return 0;
}