#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int N = 26;
long long f[MAXN], g[MAXN];
const long long mod = 1e9 + 7;
struct Palindromic_Tree {
  int next[MAXN][N];
  int fail[MAXN];
  int cnt[MAXN];
  int num[MAXN];
  int len[MAXN];
  int S[MAXN];
  int last;
  int n;
  int p;
  int delta[MAXN], start[MAXN];
  int newnode(int l) {
    for (int i = 0; i < N; ++i) next[p][i] = 0;
    cnt[p] = 0;
    num[p] = 0;
    len[p] = l;
    return p++;
  }
  void init() {
    p = 0;
    newnode(0);
    newnode(-1);
    last = 0;
    n = 0;
    S[n] = -1;
    fail[0] = 1;
  }
  int get_fail(int x) {
    while (S[n - len[x] - 1] != S[n]) x = fail[x];
    return x;
  }
  void add(int i, int c) {
    c -= 'a';
    S[++n] = c;
    int cur = get_fail(last);
    if (!next[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = next[get_fail(fail[cur])][c];
      next[cur][c] = now;
      num[now] = num[fail[now]] + 1;
      delta[now] = len[now] - len[fail[now]];
      if (delta[now] == delta[fail[now]])
        start[now] = start[fail[now]];
      else
        start[now] = now;
    }
    last = next[cur][c];
    for (int j = last; j >= 1; j = fail[start[j]]) {
      g[j] = f[i - len[start[j]]];
      if (start[j] != j) g[j] = (g[j] + g[fail[j]]) % mod;
      if (i % 2 == 0) f[i] = (f[i] + g[j]) % mod;
    }
    cnt[last]++;
  }
  void count() {
    for (int i = p - 1; i >= 0; --i) cnt[fail[i]] += cnt[i];
  }
} P;
char s[MAXN], str[MAXN];
int main() {
  scanf("%s", str);
  int n = strlen(str);
  int num = 0;
  for (int i = 1; i <= n; i += 2) s[i] = str[num++];
  num = n - 1;
  for (int i = 2; i <= n; i += 2) s[i] = str[num--];
  f[0] = 1;
  P.init();
  for (int i = 1; i <= n; i++) {
    P.add(i, s[i]);
  }
  printf("%lld", f[n]);
}
