#include <bits/stdc++.h>
bool m1;
FILE *Input = stdin, *Output = stdout;
const int maxn = 1e6 + 5, Mod = 1e9 + 7, maxa = 30;
int trans[maxn][maxa], link[maxn], len[maxn], totn;
int diff[maxn], slink[maxn], dp[maxn], Sum[maxn];
int S[maxn], pos[maxn];
char Buf[maxn];
bool m2;
int Plus(int ar1, int ar2, int ar3) {
  return ar3 - ar1 <= ar2 ? ar1 - ar3 + ar2 : ar1 + ar2;
}
int Minu(int ar1, int ar2, int ar3) {
  return ar1 - ar2 < 0 ? ar1 - ar2 + ar3 : ar1 - ar2;
}
int Mul(int ar1, int ar2, int ar3) {
  return 1LL * ar1 * ar2 >= ar3 ? 1LL * ar1 * ar2 % ar3 : ar1 * ar2;
}
void Build_PAM(int ar1[], int ar2) {
  totn = 2;
  len[1] = -1;
  len[2] = 0;
  link[2] = 1;
  int nowlast = 2;
  for (int i = 1; i <= ar2; i++) {
    int now = nowlast;
    while (ar1[i] != ar1[i - len[now] - 1]) now = link[now];
    if (!trans[now][ar1[i]]) {
      trans[now][ar1[i]] = ++totn;
      len[totn] = len[now] + 2;
      if (~len[now]) {
        int nowlink = link[now];
        while (ar1[i] != ar1[i - len[nowlink] - 1]) nowlink = link[nowlink];
        link[totn] = trans[nowlink][ar1[i]];
      } else
        link[totn] = 2;
      diff[totn] = len[totn] - len[link[totn]];
      slink[totn] =
          (diff[totn] == diff[link[totn]] ? slink[link[totn]] : link[totn]);
    }
    nowlast = trans[now][ar1[i]];
    pos[i] = nowlast;
  }
}
int main() {
  fscanf(Input, "%s", Buf + 1);
  int n = strlen(Buf + 1);
  for (int i = 1; i <= n; i++)
    S[i] = (i & 1 ? Buf[(i >> 1) + 1] : Buf[n - (i >> 1) + 1]) - 96;
  Build_PAM(S, n);
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = pos[i]; j != 2; j = slink[j]) {
      Sum[j] = Plus(link[j] == slink[j] ? 0 : Sum[link[j]],
                    dp[i - len[slink[j]] - diff[j]], Mod);
      if (!(i & 1)) dp[i] = Plus(dp[i], Sum[j], Mod);
    }
  }
  fprintf(Output, "%d\n", dp[n]);
  fclose(Input);
  fclose(Output);
  return 0;
}
