#include <bits/stdc++.h>
using namespace std;
char c[2000010], a[2000010];
const int mod = 1e9 + 7;
int n, tot, last, top[2000010], diff[2000010], ans[2000010], f[2000010];
struct PT {
  int ch[26], len, fa;
} tr[2000010];
void init() {
  tr[++tot].len = -1;
  tr[0].fa = tr[1].fa = 1;
  top[0] = 1;
}
void insert(int now, int c) {
  int x = last;
  while (a[now] != a[now - tr[x].len - 1]) x = tr[x].fa;
  if (!tr[x].ch[c]) {
    int nx = ++tot, k = tr[x].fa;
    tr[nx].len = tr[x].len + 2;
    while (a[now] != a[now - tr[k].len - 1]) k = tr[k].fa;
    tr[nx].fa = tr[k].ch[c];
    tr[x].ch[c] = tot;
    diff[nx] = tr[nx].len - tr[tr[nx].fa].len;
    if (diff[nx] == diff[tr[nx].fa])
      top[nx] = top[tr[nx].fa];
    else
      top[nx] = tr[nx].fa;
  }
  last = tr[x].ch[c];
}
int main() {
  scanf("%s", c + 1);
  int len = strlen(c + 1);
  for (int i = 1; i <= len; i++) {
    if (i & 1)
      a[i] = c[(i + 1) / 2];
    else
      a[i] = c[(len - i / 2 + 1)];
  }
  init();
  ans[0] = 1;
  for (int i = 1; i <= len; i++) {
    insert(i, a[i] - 'a');
    int x = last;
    for (; x; x = top[x]) {
      f[x] = ans[i - tr[top[x]].len - diff[x]];
      if (top[x] != tr[x].fa) f[x] = (f[x] + f[tr[x].fa]) % mod;
      if (i % 2 == 0) ans[i] = (ans[i] + f[x]) % mod;
    }
  }
  cout << ans[len];
}
