#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
char s[1000005];
namespace PalindromicAutoMaton {
int trie[1000005][26], len[1000005], fail[1000005], cnt[1000005];
int d[1000005], top[1000005];
int tot, last;
int now;
void Build() {
  tot = 1;
  len[0] = 0;
  fail[0] = 1;
  len[1] = -1;
  fail[1] = 0;
  last = 0;
  now = 0;
}
int New(int l) {
  tot++;
  memset(trie[tot], 0, sizeof(trie[tot]));
  len[tot] = l, fail[tot] = 0;
  return tot;
}
int GetFail(int x) {
  while (s[now - len[x] - 1] != s[now]) x = fail[x];
  return x;
}
void Add(int ch) {
  now++;
  int cur = GetFail(last);
  if (!trie[cur][ch]) {
    int nd = New(len[cur] + 2);
    fail[nd] = trie[GetFail(fail[cur])][ch];
    d[nd] = len[nd] - len[fail[nd]];
    top[nd] = (d[nd] == d[fail[nd]] ? top[fail[nd]] : fail[nd]);
    trie[cur][ch] = nd;
  }
  cnt[trie[cur][ch]]++;
  last = trie[cur][ch];
}
}  // namespace PalindromicAutoMaton
using namespace PalindromicAutoMaton;
char t[1000005];
int sum[1000005];
int dp[1000005];
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  int ptr = 0;
  for (int i = 1, j = n; i <= j; i++, j--) {
    s[++ptr] = t[i];
    s[++ptr] = t[j];
  }
  Build();
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    Add(s[i] - 'a');
    for (int p = last; p > 1; p = top[p]) {
      sum[p] = dp[i - len[top[p]] - d[p]];
      if (d[p] == d[fail[p]]) {
        (sum[p] += sum[fail[p]]) %= 1000000007;
      }
      if (i % 2 == 0) (dp[i] += sum[p]) %= 1000000007;
    }
  }
  printf("%d\n", dp[n]);
  return 0;
}
