#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 1e6 + 100;
const int mod = 1e9 + 7;
char s[N], t[N];
int n;
long long f[N], g[N];
struct Palindrome_tree {
  int nxt[N][26];
  int fail[N];
  int len[N];
  int cnt[N];
  int sed[N];
  int record[N];
  int diff[N], anc[N];
  char s[N];
  int tot;
  int last;
  int n;
  void newnode() {
    tot++;
    memset(nxt[tot], 0, sizeof(nxt[tot]));
    cnt[tot] = sed[tot] = len[tot] = fail[tot] = 0;
  }
  void init() {
    n = 0;
    tot = -1;
    newnode();
    newnode();
    len[0] = 0, len[1] = -1;
    tot = 1, last = 0;
    fail[0] = 1;
  }
  int getfail(int x, int n) {
    while (s[n - len[x] - 1] != s[n] || n - len[x] - 1 < 0) x = fail[x];
    return x;
  }
  void insert(char ch) {
    int c = ch - 'a';
    s[++n] = ch;
    int p = getfail(last, n);
    if (!nxt[p][c]) {
      newnode();
      len[tot] = len[p] + 2;
      fail[tot] = nxt[getfail(fail[p], n)][c];
      sed[tot] = sed[fail[tot]] + 1;
      nxt[p][c] = tot;
      diff[tot] = len[tot] - len[fail[tot]];
      anc[tot] = diff[tot] == diff[fail[tot]] ? anc[fail[tot]] : fail[tot];
    }
    last = nxt[p][c];
    cnt[last]++;
    record[last] = n;
    trans(n);
  }
  void trans(int i) {
    for (int j = last; j > 1; j = anc[j]) {
      g[j] = f[i - len[anc[j]] - diff[j]];
      if (diff[j] == diff[fail[j]]) g[j] = (g[j] + g[fail[j]]) % mod;
      f[i] = (f[i] + (i % 2 == 0) * g[j]) % mod;
    }
  }
  void get_cnt() {
    for (int i = tot; i > 0; i--) cnt[fail[i]] += cnt[i];
  }
} tree;
int main() {
  tree.init();
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n / 2; i++) {
    t[2 * i - 1] = s[i];
    t[2 * i] = s[n - i + 1];
  }
  f[0] = 1;
  for (int i = 1; i <= n; i++) tree.insert(t[i]);
  printf("%lld\n", f[n]);
  return 0;
}
