#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
struct Node {
  int t[26], len, f, tf, d, s;
} a[1000500];
int tn, las;
void linkd(int u) {
  int fa = a[u].f;
  a[u].d = a[u].len - a[fa].len;
  a[u].tf = (a[u].d == a[fa].d && a[u].d * 2 <= a[u].len) ? a[fa].tf : u;
}
void ins(int k, int c, char *str) {
  int p = las;
  while (str[k - a[p].len - 1] != c) p = a[p].f;
  if (!a[p].t[c]) {
    int np = las = ++tn, v;
    for (v = a[p].f; str[k - a[v].len - 1] != c; v = a[v].f)
      ;
    if (!a[v].t[c])
      a[np].f = 2;
    else
      a[np].f = a[v].t[c];
    a[a[p].t[c] = np].len = a[p].len + 2;
    linkd(np);
  } else
    las = a[p].t[c];
}
int f[1000500];
void dp(int k) {
  for (int p = las; p > 2; p = a[a[p].tf].f) {
    int tl = a[a[p].tf].len;
    a[p].s = f[k - tl];
    if (a[p].tf != p) a[p].s = (a[a[p].f].s + a[p].s) % mod;
    if (!(k & 1)) f[k] = (f[k] + a[p].s) % mod;
  }
}
void Init() {
  a[1].f = a[2].f = 1;
  a[1].len = -1;
  las = tn = 2;
}
int n;
char s[1000500], s2[1000500];
int main() {
  scanf("%s", s2 + 1);
  n = strlen(s2 + 1);
  if (n & 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i + i <= n; i++) {
    s[i * 2 - 1] = s2[n - i + 1];
    s[i * 2] = s2[i];
  }
  s[0] = -1;
  f[0] = 1;
  Init();
  for (int i = 1; i <= n; i++) {
    ins(i, s[i] -= 'a', s);
    dp(i);
  }
  printf("%d", f[n]);
  return 0;
}
