#include <bits/stdc++.h>
const int N = 1e6 + 5, mod = 1e9 + 7;
using namespace std;
char s[N], t[N];
namespace PAM {
int dfn, las, top, tot;
int dif[N], bot[N], pos[N];
int f[N], g[N];
struct node {
  int len, fail, c[26];
} a[N];
int getfail(int x) {
  while (s[top] != s[top - a[x].len - 1]) x = a[x].fail;
  return x;
}
void extend(int k) {
  ++top;
  int cur = getfail(las);
  if (!a[cur].c[k]) {
    int now = ++tot;
    a[now].len = a[cur].len + 2;
    a[now].fail = a[getfail(a[cur].fail)].c[k];
    dif[now] = a[now].len - a[a[now].fail].len;
    bot[now] = dif[now] == dif[a[now].fail] ? bot[a[now].fail] : now;
    a[cur].c[k] = now;
  }
  las = a[cur].c[k];
}
void build(char *s) {
  int len = strlen(s + 1);
  las = tot = 1;
  top = 0;
  a[0].len = 0, a[1].len = -1;
  a[0].fail = a[1].fail = 1;
  for (int i = 1; i <= len; ++i) extend(s[i] - 'a'), pos[i] = las;
}
void solve(int n) {
  f[0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = pos[i]; j; j = a[bot[j]].fail) {
      int t = bot[j];
      if (t != j)
        g[j] = g[a[j].fail];
      else
        g[j] = 0;
      if (a[t].len) g[j] = (g[j] + f[i - a[t].len]) % mod;
      if (i % 2 == 0) f[i] = (f[i] + g[j]) % mod;
    }
  printf("%d\n", f[n]);
}
}  // namespace PAM
int main() {
  scanf("%s", t + 1);
  int len = strlen(t + 1);
  for (int i = 1; i <= len; ++i)
    s[i] = i % 2 == 0 ? t[len - i / 2 + 1] : t[i + 1 >> 1];
  PAM::build(s);
  PAM::solve(len);
  return 0;
}
