#include <bits/stdc++.h>
using namespace std;
const int N = 1000005, M = 1e9 + 7;
int len[N], fail[N], dp[N], ne[N][26], diff[N], pre[N], tot, last, f[N];
char s1[N], s[N];
inline int getfail(int x, int y) {
  while (s1[y] != s1[y - len[x] - 1]) x = fail[x];
  return x;
}
inline void insert(int x, int y) {
  int now = getfail(last, y);
  if (!ne[now][x]) {
    tot++;
    len[tot] = len[now] + 2;
    fail[tot] = ne[getfail(fail[now], y)][x];
    ne[now][x] = tot;
    diff[tot] = len[tot] - len[fail[tot]];
    if (diff[tot] == diff[fail[tot]])
      pre[tot] = pre[fail[tot]];
    else
      pre[tot] = fail[tot];
  }
  last = ne[now][x];
}
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  tot = 1;
  last = 0;
  len[1] = -1;
  fail[0] = pre[0] = 1;
  for (int i = 1; i <= n; i++)
    if (i & 1)
      s1[i] = s[i / 2 + 1];
    else
      s1[i] = s[n - i / 2 + 1];
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    insert(s1[i] - 'a', i);
    for (int j = last; j; j = pre[j]) {
      f[j] = dp[i - len[pre[j]] - diff[j]];
      if (pre[j] != fail[j]) (f[j] += f[fail[j]]) %= M;
      if (!(i & 1)) (dp[i] += f[j]) %= M;
    }
  }
  printf("%d\n", dp[n]);
}
