#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, f[1000005], g[1000005];
char s[1000005], s2[1000005];
namespace PAM {
int fa[1000005] = {1, 1}, ch[1000005][26], len[1000005] = {0, -1}, last, sz = 1,
    anc[1000005], dif[1000005];
void extend(int x) {
  int p = last, c = s[x] - 'a';
  while (s[x] != s[x - len[p] - 1]) p = fa[p];
  if (!ch[p][c]) {
    int q = fa[p];
    len[++sz] = len[p] + 2;
    while (s[x] != s[x - len[q] - 1]) q = fa[q];
    fa[sz] = ch[q][c], dif[sz] = len[sz] - len[fa[sz]];
    anc[sz] = dif[sz] == dif[fa[sz]] ? anc[fa[sz]] : fa[sz];
    ch[p][c] = sz;
  }
  last = ch[p][c];
}
}  // namespace PAM
using namespace PAM;
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (int i = 1; i <= n; i += 2) s2[i] = s[(i + 1) / 2];
  for (int i = 2; i <= n; i += 2) s2[i] = s[n - i / 2 + 1];
  for (int i = 1; i <= n; i++) s[i] = s2[i];
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(i);
    for (int x = last; x; x = anc[x]) {
      g[x] = f[i - len[anc[x]] - dif[x]];
      if (anc[x] != fa[x]) g[x] = (g[x] + g[fa[x]]) % mod;
      if (!(i & 1)) f[i] = (f[i] + g[x]) % mod;
    }
  }
  printf("%d\n", f[n]);
}
