#include <bits/stdc++.h>
using namespace std;
int n, K;
struct PAM {
  struct node {
    int ch[26];
    int len, fail;
    int dif, slink;
  } t[2000000 + 5];
  int ptr = 0, last = 0;
  char *str;
  void ini(char *in) {
    str = in;
    ptr = 1;
    (t[0].fail) = 1;
    (t[1].len) = -1;
  }
  int get_fail(int x, int n) {
    while (str[n - (t[x].len) - 1] != str[n]) x = (t[x].fail);
    return x;
  }
  void insert(int c, int pos) {
    int p = get_fail(last, pos);
    if (!t[p].ch[c]) {
      int cur = ++ptr;
      (t[cur].len) = (t[p].len) + 2;
      (t[cur].fail) = t[get_fail((t[p].fail), pos)].ch[c];
      t[cur].dif = (t[cur].len) - (t[(t[cur].fail)].len);
      if (t[cur].dif == t[(t[cur].fail)].dif)
        t[cur].slink = t[(t[cur].fail)].slink;
      else
        t[cur].slink = (t[cur].fail);
      t[p].ch[c] = cur;
    }
    last = t[p].ch[c];
  }
  int dp[2000000 + 5], g[2000000 + 5];
  int solve() {
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
      insert(str[i] - 'a', i);
      for (int x = last; x > 1; x = t[x].slink) {
        g[x] = dp[i - (t[t[x].slink].len) - t[x].dif];
        if (t[x].dif == t[(t[x].fail)].dif)
          g[x] = (g[x] + g[(t[x].fail)]) % 1000000007;
        if (i % 2 == 0) dp[i] = (dp[i] + g[x]) % 1000000007;
      }
    }
    return dp[n];
  }
} T;
char s[2000000 + 5], t[2000000 + 5];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1, ptr = 0; i <= n / 2; i++) {
    t[++ptr] = s[i];
    t[++ptr] = s[n - i + 1];
  }
  T.ini(t);
  printf("%d\n", T.solve());
}
