#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, P = 1e9 + 7;
int n, cnt, pos[N], len[N], dis[N], fa[N], top[N], ch[N][26];
char t[N], s[N];
int f[N], ans[N];
int jump(int x, int p) {
  while (s[p - len[x] - 1] != s[p]) x = fa[x];
  return x;
}
int Insert(int x, int p) {
  x = jump(x, p);
  int c = s[p] - 'a';
  if (!ch[x][c]) {
    ++cnt;
    len[cnt] = len[x] + 2;
    int y = jump(fa[x], p);
    fa[cnt] = ch[y][c];
    y = cnt;
    dis[y] = len[y] - len[fa[y]];
    if (dis[y] != dis[fa[y]])
      top[y] = y;
    else
      top[y] = top[fa[y]];
    ch[x][c] = y;
  }
  return ch[x][c];
}
int main() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  if (n & 1) return puts("0") & 0;
  for (int i = 1; i <= n; i += 2) s[i] = t[i / 2 + 1];
  for (int i = 2; i <= n; i += 2) s[i] = t[n - i / 2 + 1];
  len[1] = -1;
  fa[0] = top[1] = cnt = 1;
  for (int i = 1; i <= n; i++) pos[i] = Insert(pos[i - 1], i);
  ans[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int x = pos[i]; x; x = fa[top[x]]) {
      f[x] = ans[i - len[top[x]]];
      if (x != top[x]) (f[x] += f[fa[x]]) %= P;
      if (!(i & 1)) (ans[i] += f[x]) %= P;
    }
  }
  printf("%d\n", ans[n]);
  return 0;
}
