#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, mod = 1e9 + 7;
int ch[N][26], fa[N], g[N], f[N], tot, lst, nxt[N], l[N], s[N], dif[N], pos[N];
char t[N];
int read() {
  int x = 0;
  char c = getchar(), flag = '+';
  while (!isdigit(c)) flag = c, c = getchar();
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return flag == '-' ? -x : x;
}
int Insert(int x, int c) {
  int p = lst;
  while (s[x - l[p] - 1] ^ c) p = fa[p];
  if (!ch[p][c]) {
    int now = ++tot, q = fa[p];
    l[now] = l[p] + 2;
    while (s[x - l[q] - 1] ^ c) q = fa[q];
    int t = ch[q][c];
    dif[now] = l[now] - l[t];
    fa[now] = t;
    if (dif[now] == dif[t])
      nxt[now] = nxt[t];
    else
      nxt[now] = t;
    ch[p][c] = now;
  }
  return lst = ch[p][c];
}
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      s[i] = t[i + 1 >> 1] - 'a';
    else
      s[i] = t[n - i / 2 + 1] - 'a';
  }
  s[0] = -1;
  tot = 1, l[1] = -1, fa[0] = 1;
  for (int i = 1; i <= n; i++) pos[i] = Insert(i, s[i]);
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int x = pos[i]; x; x = nxt[x]) {
      g[x] = f[i - l[nxt[x]] - dif[x]];
      if (dif[x] == dif[fa[x]])
        g[x] = g[x] + g[fa[x]] >= mod ? g[x] + g[fa[x]] - mod : g[x] + g[fa[x]];
      if (!(i & 1)) f[i] = f[i] + g[x] >= mod ? f[i] + g[x] - mod : f[i] + g[x];
    }
  }
  cout << f[n];
  return 0;
}
