#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
template <typename T>
inline void Add(T &x, T y) {
  x += y;
  if (x >= mod) x -= mod;
}
namespace PAM {
int ne[1000010][26], fail[1000010], len[1000010], las, cnt, n, d[1000010],
    anc[1000010], t[1000010];
long long info[1000010];
void init() {
  t[n = 0] = -1;
  len[cnt = 1] = -1;
  fail[las = 0] = 1;
}
inline int getfail(int x) {
  for (; t[n - len[x] - 1] != t[n];) x = fail[x];
  return x;
}
inline void extend(int c) {
  t[++n] = c;
  int p = getfail(las);
  if (!ne[p][c]) {
    int u = ++cnt, q = getfail(fail[p]);
    len[u] = len[p] + 2;
    fail[u] = ne[q][c];
    ne[p][c] = u;
    d[u] = len[u] - len[fail[u]];
    anc[u] = (d[u] == d[fail[u]]) ? anc[fail[u]] : fail[u];
  }
  las = ne[p][c];
}
}  // namespace PAM
using PAM::anc;
using PAM::d;
using PAM::extend;
using PAM::fail;
using PAM::info;
using PAM::init;
using PAM::las;
using PAM::len;
long long f[1000010];
int n;
char t[1000010], s[1000010];
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  for (int i = 1; i <= (n >> 1); i++)
    s[(i << 1) - 1] = t[i], s[i << 1] = t[n - i + 1];
  init();
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(s[i] - 'a');
    for (int j = las; len[j] > 0; j = anc[j]) {
      info[j] = f[i - len[anc[j]] - d[j]];
      if (anc[j] != fail[j]) Add(info[j], info[fail[j]]);
      if (!(i & 1)) Add(f[i], info[j]);
    }
  }
  printf("%lld\n", f[n]);
  return 0;
}
