#include <bits/stdc++.h>
using namespace std;
int n, s[1000005], top[1000005], f[1000005], g[1000005];
int c[1000005][26], F[1000005], len[1000005], cnt, pos[1000005];
char str[1000005];
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  s[0] = -1;
  for (int i = 1; i <= n / 2; i++) {
    s[i * 2 - 1] = str[i] - 'a';
    s[i * 2] = str[n - i + 1] - 'a';
  }
  len[0] = -1;
  cnt = 1;
  for (int i = 1, now = 1; i <= n; i++) {
    while (s[i - len[now] - 1] != s[i]) now = F[now];
    if (!c[now][s[i]]) {
      cnt++;
      len[cnt] = len[now] + 2;
      int tmp = F[now];
      while (s[i - len[tmp] - 1] != s[i]) tmp = F[tmp];
      F[cnt] = c[tmp][s[i]] ? c[tmp][s[i]] : 1;
      c[now][s[i]] = cnt;
    }
    pos[i] = now = c[now][s[i]];
  }
  top[1] = 1;
  for (int i = 2; i <= cnt; i++)
    if (F[i] != 1 && len[i] + len[F[F[i]]] == len[F[i]] * 2)
      top[i] = top[F[i]];
    else
      top[i] = i;
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = pos[i]; j != 1; j = F[top[j]]) {
      if (top[j] != j)
        g[j] = (g[F[j]] + f[i - len[top[j]]]) % 1000000007;
      else
        g[j] = f[i - len[j]];
      f[i] = (f[i] + g[j]) % 1000000007;
    }
    if (i & 1) f[i] = 0;
  }
  printf("%d\n", f[n]);
}
