#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
char t[N];
int n, m = 0, s[N], ch[N][26], fa[N], len[N], diff[N], anc[N], tot = 0, p = 0,
       f[N], g[N];
void extend(int n, int c) {
  while (s[n] != s[n - len[p] - 1]) p = fa[p];
  if (!ch[p][c]) {
    int q = ++tot;
    len[q] = len[p] + 2;
    int v = fa[p];
    while (s[n] != s[n - len[v] - 1]) v = fa[v];
    fa[q] = ch[v][c];
    ch[p][c] = q;
    diff[q] = len[q] - len[fa[q]],
    anc[q] = diff[q] == diff[fa[q]] ? anc[fa[q]] : fa[q];
  }
  p = ch[p][c];
}
int main() {
  scanf("%s", t + 1), n = strlen(t + 1);
  for (int i = 1; i <= n / 2; i++)
    s[++m] = t[i] - 'a', s[++m] = t[n - i + 1] - 'a';
  s[0] = -1, s[n + 1] = -2;
  len[++tot] = -1, fa[0] = fa[1] = 1;
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(i, s[i]);
    for (int v = p; v; v = anc[v]) {
      g[v] = f[i - len[anc[v]] - diff[v]];
      if (fa[v] != anc[v]) g[v] = (g[v] + g[fa[v]]) % mod;
      if (!(i & 1)) f[i] = (f[i] + g[v]) % mod;
    }
  }
  printf("%d\n", f[n]);
  return 0;
}
