#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  T data = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    data = (data << 3) + (data << 1) + ch - '0';
    ch = getchar();
  }
  x = f * data;
}
template <typename T, typename... Args>
inline void read(T &t, Args &...args) {
  read(t);
  read(args...);
}
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
const int maxn = 1e6 + 9;
const int mod = 1e9 + 7;
char st[maxn], t[maxn];
int anc[maxn], dp[maxn], diff[maxn], val[maxn];
namespace PAM {
int sz, tot, last;
int cnt[maxn], ch[maxn][26], len[maxn], fail[maxn];
char s[maxn];
int newnode(int ln) {
  sz++;
  memset(ch[sz], 0, sizeof(ch[sz]));
  len[sz] = ln;
  fail[sz] = cnt[sz] = 0;
  return sz;
}
void clear() {
  sz = -1;
  last = tot = 0;
  s[tot] = '$';
  newnode(0);
  newnode(-1);
  fail[0] = 1;
}
int getfail(int x) {
  while (s[tot - len[x] - 1] != s[tot]) x = fail[x];
  return x;
}
void insert(char c) {
  s[++tot] = c;
  int now = getfail(last);
  if (!ch[now][c - 'a']) {
    int x = newnode(len[now] + 2);
    fail[x] = ch[getfail(fail[now])][c - 'a'];
    ch[now][c - 'a'] = x;
    diff[x] = len[x] - len[fail[x]];
    anc[x] = (diff[x] == diff[fail[x]] ? anc[fail[x]] : fail[x]);
  }
  last = ch[now][c - 'a'];
  cnt[last]++;
}
};  // namespace PAM
using namespace PAM;
signed main() {
  scanf("%s", st + 1);
  int n = strlen(st + 1), l = 1, r = n;
  for (int i = 1; i <= n; ++i) {
    if (i & 1)
      t[i] = st[l++];
    else
      t[i] = st[r--];
  }
  clear();
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    insert(t[i]);
    for (int j = last; j; j = anc[j]) {
      if (anc[j] != fail[j])
        val[j] = val[fail[j]];
      else
        val[j] = 0;
      int k = i - len[anc[j]] - diff[j];
      val[j] = (val[j] + dp[k]) % mod;
      if (i % 2 == 0) dp[i] = (dp[i] + val[j]) % mod;
    }
  }
  printf("%d\n", dp[n]);
  return 0;
}
