#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  char c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}
template <typename T, typename... U>
inline void read(T& x, U&... y) {
  read(x), read(y...);
}
const int N = 1e6 + 10, P = 1e9 + 7;
int n, cnt, now, last;
int fa[N], len[N], d[N], top[N], ch[N][26];
char s[N], t[N];
int F[N], G[N];
void Init() {
  cnt = 1;
  len[1] = -1;
  s[0] = '#';
  fa[0] = 1;
}
int Fail(int p) {
  while (s[now - len[p] - 1] != s[now]) p = fa[p];
  return p;
}
void Extend(int x) {
  int p = Fail(last);
  if (!ch[p][x]) {
    int np = ++cnt;
    len[np] = len[p] + 2;
    fa[np] = ch[Fail(fa[p])][x];
    d[np] = len[np] - len[fa[np]];
    top[np] = d[np] == d[fa[np]] ? top[fa[np]] : fa[np];
    ch[p][x] = np;
  }
  last = ch[p][x];
}
int main() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  if (n & 1) return puts("0"), 0;
  for (int i = 1; i <= n >> 1; ++i) s[i * 2 - 1] = t[i];
  for (int i = n; i > n >> 1; --i) s[(n - i + 1) * 2] = t[i];
  Init();
  F[0] = 1;
  for (int i = 1; i <= n; ++i) {
    now = i;
    Extend(s[i] - 'a');
    for (int p = last; p > 1; p = top[p]) {
      G[p] = F[i - len[top[p]] - d[p]];
      if (d[p] == d[fa[p]]) (G[p] += G[fa[p]]) %= P;
      if (i % 2 == 0) (F[i] += G[p]) %= P;
    }
  }
  printf("%d\n", F[n]);
  return 0;
}
