#include <bits/stdc++.h>
template <class T>
inline bool cmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
inline bool cmin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
using namespace std;
const int N = 1e6 + 5, P = 1e9 + 7;
typedef int arr[N];
struct PAM {
  int n, T, las, ch[N][26];
  char s[N];
  arr fa, len, gp, d;
  inline void init() {
    las = n = 0;
    T = fa[0] = 1, s[0] = len[1] = -1;
  }
  inline int gf(int x) {
    while (s[n - len[x] - 1] ^ s[n]) x = fa[x];
    return x;
  }
  inline void ins(int v) {
    s[++n] = v;
    las = gf(las);
    if (!ch[las][v]) {
      fa[++T] = ch[gf(fa[las])][v], len[T] = len[las] + 2;
      d[T] = len[T] - len[fa[T]];
      ch[las][v] = T;
      gp[T] = d[T] == d[fa[T]] ? gp[fa[T]] : fa[T];
    }
    las = ch[las][v];
  }
} p;
int n;
arr f, g;
char s[N], ch[N];
inline int add(int a, int b) { return a += b, a >= P ? a - P : a; }
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  f[0] = 1;
  if (n & 1) return puts("0"), 0;
  p.init();
  for (int i = 1; i <= n; i += 2) ch[i] = s[(i >> 1) + 1];
  for (int i = 2; i <= n; i += 2) ch[i] = s[n - (i >> 1) + 1];
  for (register int i = 1, I = n + 1; i < I; ++i) {
    p.ins(ch[i] - 'a');
    for (int j = p.las; j; j = p.gp[j]) {
      g[j] = f[i - p.len[p.gp[j]] - p.d[j]];
      if (p.gp[j] ^ p.fa[j]) g[j] = add(g[j], g[p.fa[j]]);
      if (~i & 1) f[i] = add(f[i], g[j]);
    }
  }
  printf("%d", f[n]);
  return 0;
}
