#include <bits/stdc++.h>
using namespace std;
template <class T>
T read() {
  T x = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -w;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * w;
}
template <class T>
inline T read(T& x) {
  return x = read<T>();
}
const int mod = 1000000000 + 7;
inline int add(int a, int b) { return (a += b) >= mod ? a - mod : a; }
inline int mul(int a, int b) { return (long long)a * b % mod; }
inline int fpow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) ans = mul(ans, a);
  return ans;
}
const int N = 1000000 + 10;
namespace PAM {
int str[N], n;
int last, tot;
int ch[N][26], trans[N][26], len[N], fa[N];
int diff[N], anc[N];
void init() {
  memset(str, -1, sizeof str), n = 0;
  last = tot = 1;
  len[0] = 0, len[1] = -1, fa[0] = fa[1] = 1;
  fill(trans[0], trans[0] + 26, 1);
  diff[0] = 0;
}
void extend(int c) {
  str[++n] = c;
  int p = last;
  if (str[n - len[p] - 1] != str[n]) p = trans[p][c];
  if (!ch[p][c]) {
    int cur = ++tot;
    len[cur] = len[p] + 2;
    fa[cur] = ch[trans[p][c]][c];
    ch[p][c] = cur;
    copy(trans[fa[cur]], trans[fa[cur]] + 26, trans[cur]);
    trans[cur][str[n - len[fa[cur]]]] = fa[cur];
    diff[cur] = len[cur] - len[fa[cur]];
    anc[cur] = diff[cur] == diff[fa[cur]] ? anc[fa[cur]] : fa[cur];
  }
  last = ch[p][c];
}
}  // namespace PAM
char tmp[N], str[N];
int dp[N], ans[N];
int main() {
  scanf("%s", tmp + 1);
  int n = strlen(tmp + 1);
  if (n & 1) return puts("0"), 0;
  for (int i = 1; i <= n; i += 2) str[i] = tmp[(i + 1) / 2];
  reverse(tmp + 1, tmp + n + 1);
  for (int i = 2; i <= n; i += 2) str[i] = tmp[i / 2];
  PAM::init();
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    PAM::extend(str[i] - 'a');
    for (int p = PAM::last; p; p = PAM::anc[p]) {
      dp[p] = ans[i - PAM::len[PAM::anc[p]] - PAM::diff[p]];
      if (PAM::anc[p] != PAM::fa[p]) dp[p] = add(dp[p], dp[PAM::fa[p]]);
      if (~i & 1) ans[i] = add(ans[i], dp[p]);
    }
  }
  printf("%d\n", ans[n]);
  return 0;
}
