#include <bits/stdc++.h>
using namespace std;
using std::bitset;
const double Pi = acos(-1);
namespace fastIO {
template <class T>
inline void read(T &x) {
  x = 0;
  bool fu = 0;
  char ch = 0;
  while (ch > '9' || ch < '0') {
    ch = getchar();
    if (ch == '-') fu = 1;
  }
  while (ch <= '9' && ch >= '0') x = (x * 10 - 48 + ch), ch = getchar();
  if (fu) x = -x;
}
inline int read() {
  int x = 0;
  bool fu = 0;
  char ch = 0;
  while (ch > '9' || ch < '0') {
    ch = getchar();
    if (ch == '-') fu = 1;
  }
  while (ch <= '9' && ch >= '0') x = (x * 10 - 48 + ch), ch = getchar();
  return fu ? -x : x;
}
char _n_u_m_[40];
template <class T>
inline void write(T x) {
  if (x == 0) {
    putchar('0');
    return;
  }
  T tmp = x > 0 ? x : -x;
  if (x < 0) putchar('-');
  register int cnt = 0;
  while (tmp > 0) {
    _n_u_m_[cnt++] = tmp % 10 + '0';
    tmp /= 10;
  }
  while (cnt > 0) putchar(_n_u_m_[--cnt]);
}
template <class T>
inline void write(T x, char ch) {
  write(x);
  putchar(ch);
}
}  // namespace fastIO
using namespace fastIO;
const int MAXN = 1000005;
int len[MAXN], ch[MAXN][26], fail[MAXN], cnt, lst, up[MAXN], orz[MAXN];
long long qwq[MAXN], ans[MAXN];
char c[MAXN], ccf[MAXN];
int now, n;
inline void insert(int pos) {
  while (c[pos] != c[pos - len[lst] - 1]) lst = fail[lst];
  if (!ch[lst][c[pos] - 97]) {
    len[++cnt] = len[lst] + 2;
    register int i = fail[lst];
    while (c[pos] != c[pos - len[i] - 1]) i = fail[i];
    fail[cnt] = ch[i][c[pos] - 97];
    ch[lst][c[pos] - 97] = cnt;
    orz[cnt] = len[cnt] - len[fail[cnt]];
    if (orz[cnt] == orz[fail[cnt]])
      up[cnt] = up[fail[cnt]];
    else
      up[cnt] = fail[cnt];
  }
  lst = ch[lst][c[pos] - 97];
}
int main() {
  len[1] = -1;
  fail[0] = 1;
  up[0] = 1;
  ans[0] = 1;
  cnt = 1;
  scanf("%s", ccf + 1);
  n = strlen(ccf + 1);
  if (n % 2) {
    cerr << "Fuck CCF!!!" << endl;
    cout << 0;
    return 0;
  }
  for (register int i = 1, iend = n / 2; i <= iend; ++i) {
    c[2 * i - 1] = ccf[i];
    c[i << 1] = ccf[n - i + 1];
  }
  for (register int i = 1, iend = n; i <= iend; ++i) {
    insert(i);
    for (register int j = lst; j; j = up[j]) {
      qwq[j] = ans[i - len[up[j]] - orz[j]];
      if (up[j] != fail[j]) qwq[j] += qwq[fail[j]];
      qwq[j] %= 1000000007ll;
      if (!(i & 1)) ans[i] += qwq[j], ans[i] %= 1000000007ll;
    }
  }
  cout << ans[n];
  return 0;
}
