#include <bits/stdc++.h>
using namespace std;
const int LETTER = 26, MOD = 1000000007;
int add(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }
struct PAMNode {
  int fail, len, go[LETTER], slink, diff;
  PAMNode(int f = 0, int l = 0) : fail(f), len(l), go{}, slink(0), diff(0) {}
};
struct PAM {
  vector<PAMNode> a;
  vector<int> s;
  int last, n;
  int dp[1000200], sum[1000020];
  PAM() : a(0), s(1, -1), last(0), n(1) {
    a.emplace_back(1, 0);
    a.emplace_back(1, -1);
    dp[0] = 1;
  }
  int getFail(int v) {
    while (s[n - a[v].len - 2] != s[n - 1]) v = a[v].fail;
    return v;
  }
  int insert(int x) {
    s.push_back(x), n++;
    last = getFail(last);
    if (!a[last].go[x]) {
      a.emplace_back(a[getFail(a[last].fail)].go[x], a[last].len + 2);
      a.back().diff = a.back().len - a[a.back().fail].len;
      a.back().slink = a.back().diff == a[a.back().fail].diff
                           ? a[a.back().fail].slink
                           : a.back().fail;
      a[last].go[x] = (int)a.size() - 1;
    }
    return last = a[last].go[x];
  }
  void trans(int i) {
    for (int p = last; a[p].len > 0; p = a[p].slink) {
      sum[p] = dp[i - a[a[p].slink].len - a[p].diff];
      if (a[p].diff == a[a[p].fail].diff) sum[p] = add(sum[p], sum[a[p].fail]);
      if (i % 2 == 0) dp[i] = add(dp[i], sum[p]);
    }
  }
} pam;
int main() {
  string s;
  deque<char> deq;
  char ch = getchar();
  while (isalpha(ch)) {
    deq.push_back(ch);
    ch = getchar();
  }
  int tot = 0;
  while (!deq.empty()) {
    if (++tot & 1)
      s += deq.front(), deq.pop_front();
    else
      s += deq.back(), deq.pop_back();
  }
  for (int i = 0; i < (int)s.length(); ++i) {
    pam.insert(s[i] - 'a');
    pam.trans(i + 1);
  }
  printf("%d\n", pam.dp[pam.n - 1]);
  return 0;
}
