#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 7;
int MOD = 1e9 + 7;
namespace PAM {
int scnt, S[MAXN];
int pcnt, last, len[MAXN], fail[MAXN], ch[MAXN][26];
int cnt[MAXN], num[MAXN], trans[MAXN], diff[MAXN], slink[MAXN];
int newnode(int _len) {
  len[pcnt] = _len;
  cnt[pcnt] = num[pcnt] = 0;
  for (int i = 0; i < 26; i++) ch[pcnt][i] = 0;
  return pcnt++;
}
inline void init() {
  S[scnt = 0] = -1;
  pcnt = 0;
  newnode(0);
  newnode(-1);
  fail[0] = 1;
  last = 0;
}
int getfail(int x) {
  while (S[scnt - len[x] - 1] != S[scnt]) x = fail[x];
  return x;
}
void extend(int c) {
  S[++scnt] = c;
  int cur = getfail(last);
  if (!ch[cur][c]) {
    int now = newnode(len[cur] + 2);
    fail[now] = ch[getfail(fail[cur])][c];
    ch[cur][c] = now;
    num[now] = num[fail[now]] + 1;
    if (len[now] <= 2)
      trans[now] = fail[now];
    else {
      int x = trans[cur];
      while (S[scnt - len[x] - 1] != S[scnt] || (len[x] + 2) * 2 > len[now])
        x = fail[x];
      trans[now] = ch[x][c];
    }
    diff[now] = len[now] - len[fail[now]];
    slink[now] = (diff[now] == diff[fail[now]]) ? slink[fail[now]] : fail[now];
  }
  last = ch[cur][c];
  cnt[last]++;
}
void count() {
  for (int i = pcnt - 1; i >= 0; i--) cnt[fail[i]] += cnt[i];
}
};  // namespace PAM
using namespace PAM;
int g[MAXN], f[MAXN];
void sol(int i, int cur) {
  for (; cur; cur = slink[cur]) {
    g[cur] = f[i - len[slink[cur]] - diff[cur]];
    if (slink[cur] != fail[cur]) g[cur] = (g[cur] + g[fail[cur]]) % MOD;
    f[i] = (f[i] + g[cur]) % MOD;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int sn = s.size();
  init();
  f[0] = 1;
  for (int i = 0; i < sn; i += 2) {
    extend(s[i >> 1] - 'a');
    sol(i + 1, last);
    f[i + 1] = 0;
    extend(s[sn - 1 - (i >> 1)] - 'a');
    sol(i + 2, last);
  }
  cout << f[sn] << endl;
  return 0;
}
