#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, ch[1000005][27], fa[1000005], tp[1000005], sum[1000005],
    dp[1000005], df[1000005], len[1000005], lst, cnt, mod = 1e9 + 7;
string s, t;
int gtpre(int x, int i) {
  while (t[i - len[x] - 1] != t[i]) {
    x = fa[x];
  }
  return x;
}
void ins(int i) {
  lst = gtpre(lst, i);
  if (!ch[lst][t[i] - 'a']) {
    fa[++cnt] = ch[gtpre(fa[lst], i)][t[i] - 'a'];
    ch[lst][t[i] - 'a'] = cnt;
    len[cnt] = len[lst] + 2;
    df[cnt] = len[cnt] - len[fa[cnt]];
    if (df[cnt] == df[fa[cnt]])
      tp[cnt] = tp[fa[cnt]];
    else
      tp[cnt] = cnt;
  }
  lst = ch[lst][t[i] - 'a'];
  int x = lst;
  while (x) {
    sum[x] = dp[i - len[tp[x]]];
    if (tp[x] != x) (sum[x] += sum[fa[x]]) %= mod;
    if (!(i & 1)) (dp[i] += sum[x]) %= mod;
    x = fa[tp[x]];
  }
}
int main() {
  cnt = 1;
  fa[0] = 1;
  len[1] = -1;
  lst = 0;
  {
    static char ss[1000005];
    scanf(" %s", ss);
    (s) = ss;
  };
  t = s;
  for ((i) = 0; (i) < (s.length()); (i)++)
    if (!(i & 1))
      t[i] = s[i / 2];
    else
      t[i] = s[s.length() - i / 2 - 1];
  t = " " + t;
  s = t;
  dp[0] = 1;
  for ((i) = 1; (i) <= (s.length() - 1); (i)++) ins(i);
  cout << dp[s.length() - 1] << endl;
  return 0;
}
