#include <bits/stdc++.h>
using namespace std;
int n;
char c[1000100], S[1000100];
struct node {
  int tr[26];
  int len, fail;
} s[1000100];
int ptr, last;
int newnode(int l) {
  s[ptr].len = l;
  return ptr++;
}
void init() {
  ptr = last = 0;
  newnode(0);
  newnode(-1);
  s[0].fail = 1;
  return;
}
int getfail(int i, int p) {
  while (c[i - s[p].len - 1] != c[i]) p = s[p].fail;
  return p;
}
int diff[1000100], anc[1000100];
void extend(int i, int k) {
  int p = getfail(i, last);
  if (s[p].tr[k] == 0) {
    int np = newnode(s[p].len + 2);
    s[np].fail = s[getfail(i, s[p].fail)].tr[k];
    s[p].tr[k] = np;
    diff[np] = s[np].len - s[s[np].fail].len;
    anc[np] = (diff[np] == diff[s[np].fail] ? anc[s[np].fail] : s[np].fail);
  }
  last = s[p].tr[k];
  return;
}
int f[1000100], ans[1000100];
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  if (n & 1) {
    puts("0");
    return 0;
  }
  init();
  int cur = 0;
  for (int i = 1, j = n; i < j; ++i, --j) {
    c[++cur] = S[i];
    c[++cur] = S[j];
  }
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    extend(i, c[i] - 'a');
    for (int p = last; p != 0; p = anc[p]) {
      f[p] = ans[i - s[anc[p]].len - diff[p]];
      if (anc[p] != s[p].fail) f[p] = (f[p] + f[s[p].fail]) % 1000000007;
      if (i % 2 == 0) ans[i] = (ans[i] + f[p]) % 1000000007;
    }
  }
  cout << ans[n] << endl;
  return 0;
}
