#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10, MAXM = 4e6 + 10;
const int INF = INT_MAX, SINF = 0x3f3f3f3f;
const long long llINF = LLONG_MAX;
const int MOD = 1e9 + 7, mod = 119;
const int Lim = 1 << 20;
struct PAM {
  int sz, tot, last;
  int ch[MAXN][26], len[MAXN], fail[MAXN];
  int cnt[MAXN], dep[MAXN], dif[MAXN], slink[MAXN];
  char s[MAXN];
  int newnode(int l) {
    sz++;
    memset(ch[sz], 0, sizeof(ch[sz]));
    len[sz] = l;
    fail[sz] = cnt[sz] = dep[sz] = 0;
    return sz;
  }
  void init() {
    sz = -1;
    last = 0;
    s[tot = 0] = '$';
    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'];
      dep[x] = dep[fail[x]] + 1;
      ch[now][c - 'a'] = x;
      dif[x] = len[x] - len[fail[x]];
      if (dif[x] == dif[fail[x]])
        slink[x] = slink[fail[x]];
      else
        slink[x] = fail[x];
    }
    last = ch[now][c - 'a'];
    cnt[last]++;
  }
} pam;
int n, dp[MAXN], g[MAXN];
char s[MAXN], t[MAXN];
int main() {
  pam.init();
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1, j = 0; i <= n; i++) t[++j] = s[i], t[++j] = s[n - i + 1];
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    pam.insert(t[i]);
    for (int x = pam.last; x > 1; x = pam.slink[x]) {
      g[x] = dp[i - pam.len[pam.slink[x]] - pam.dif[x]];
      if (pam.dif[x] == pam.dif[pam.fail[x]])
        g[x] = (g[x] + g[pam.fail[x]]) % MOD;
      if (i % 2 == 0) dp[i] = (dp[i] + g[x]) % MOD;
    }
  }
  printf("%d", dp[n]);
  return 0;
}
