#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int n, las, tot, cnt;
int len[2000010], fail[2000010], ch[2000010][26], slink[2000010], diff[2000010],
    f[2000010], g[2000010];
char s[2000010], str[2000010];
void init() { len[1] = -1, fail[0] = fail[1] = tot = 1; }
void insert(int i) {
  int p = las, c = s[i] - 'a';
  while (s[i - 1 - len[p]] != s[i]) p = fail[p];
  if (ch[p][c]) {
    las = ch[p][c];
    return;
  }
  int x = fail[p], y = ++tot;
  while (s[i - 1 - len[x]] != s[i]) x = fail[x];
  fail[y] = ch[x][c], len[y] = len[p] + 2, ch[p][c] = las = y,
  diff[y] = len[y] - len[fail[y]];
  if (diff[y] == diff[fail[y]])
    slink[y] = slink[fail[y]];
  else
    slink[y] = fail[y];
}
int main() {
  init(), scanf("%s", str + 1), n = strlen(str + 1), f[0] = 1;
  for (int i = 1; i <= 2 * n; i += 2) s[i] = str[++cnt];
  for (int i = 2; i <= 2 * n; i += 2) s[i] = str[cnt--];
  for (int i = 1; i <= n; ++i) {
    insert(i);
    for (int p = las; p; p = slink[p]) {
      g[p] = f[i - len[slink[p]] - diff[p]];
      if (slink[p] != fail[p]) g[p] = (g[p] + g[fail[p]]) % 1000000007;
      if (!(i & 1)) f[i] = (f[i] + g[p]) % 1000000007;
    }
  }
  printf("%d", f[n]);
  return 0;
}
