#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mo = 1e9 + 7;
char s[N], g[N];
int n, slink[N], link[N], c[N][26], len[N], tot, last, d[N];
long long f[N], sumf[N][2];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (n % 2) {
    printf("0");
    return 0;
  }
  for (int i = 1; i * 2 <= n; i++) g[i * 2 - 1] = s[i];
  for (int i = n, w = 2; i > (n >> 1); i--, w += 2) {
    g[w] = s[i];
  }
  memcpy(s, g, sizeof s);
  f[0] = 1;
  len[1] = -1;
  link[0] = 1;
  tot = 1;
  for (int i = 1; i <= n; i++) {
    while (s[i - 1 - len[last]] != s[i]) {
      last = link[last];
    }
    int r = s[i] - 'a';
    if (c[last][r] == 0) {
      len[++tot] = len[last] + 2;
      int k = link[last];
      while (s[i - 1 - len[k]] != s[i]) k = link[k];
      link[tot] = c[k][r];
      c[last][r] = tot;
      d[tot] = len[tot] - len[link[tot]];
      slink[tot] = d[tot] == d[link[tot]] ? slink[link[tot]] : link[tot];
    }
    last = c[last][r];
    for (int v = last; len[v] > 0; v = slink[v]) {
      sumf[v][0] = sumf[v][1] = 0;
      sumf[v][(i - len[slink[v]] - d[v]) & 1] = f[i - len[slink[v]] - d[v]];
      if (d[v] == d[link[v]]) {
        sumf[v][0] = (sumf[v][0] + sumf[link[v]][0]) % mo;
        sumf[v][1] = (sumf[v][1] + sumf[link[v]][1]) % mo;
      }
      f[i] = (f[i] + sumf[v][i & 1]) % mo;
    }
  }
  cout << f[n] << endl;
}
