#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
int n, l, t, las, cnt, a[1000005], fail[1000005], len[1000005], h[1000005],
    g[1000005], f[1000005], ans[1000005], tr[1000005][28];
char s[1000005];
inline int get_fail(int x, int y) {
  while (a[x] != a[x - len[y] - 1]) y = fail[y];
  return y;
}
int main() {
  scanf("%s", s), n = strlen(s), l = n >> 1, fail[0] = ans[0] = cnt = 1,
                  len[1] = a[0] = -1;
  if (n & 1) {
    puts("0");
    return 0;
  }
  for (register int i = 0; i < l; ++i) a[(i << 1) | 1] = s[i] - 97;
  for (register int i = l; i < n; ++i) a[(n - i) << 1] = s[i] - 97;
  for (register int i = 1; i <= n; ++i) {
    t = get_fail(i, las);
    if (!tr[t][a[i]]) {
      fail[++cnt] = tr[get_fail(i, fail[t])][a[i]], len[cnt] = len[t] + 2,
      h[cnt] = len[cnt] - len[fail[cnt]], tr[t][a[i]] = cnt;
      if (h[cnt] == h[fail[cnt]])
        g[cnt] = g[fail[cnt]];
      else
        g[cnt] = fail[cnt];
    }
    las = tr[t][a[i]];
    for (register int j = las; j; j = g[j]) {
      f[j] = ans[i - len[g[j]] - h[j]];
      if (g[j] != fail[j]) f[j] = (f[j] + f[fail[j]]) % Mod;
      if (!(i & 1)) ans[i] = (ans[i] + f[j]) % Mod;
    }
  }
  printf("%d", ans[n]);
  return 0;
}
