Problem: Given a string s, find the number of ways to split s to substrings such that if there are k substrings (p1, p2, p3, ..., pk) in partition, then pi = pk - i + 1 for all i (1 ≤ i ≤ k) and k is even.

Since the number of ways can be large, print it modulo 109 + 7.

Input

The only line of input contains a string s (2 ≤ |s| ≤ 106) of even length consisting of lowercase Latin letters. 

Output

Print one integer, the number of ways of partitioning the string modulo 109 + 7.

Examples

Input

abcdcdab


Output

1

Input

abbababababbab


Output

3

Note

In the first case, the only way to partition the string is ab|cd|cd|ab.

In the second case, the string can be partitioned as ab|b|ab|ab|ab|ab|b|ab or ab|b|abab|abab|b|ab or abbab|ab|ab|abbab.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
T read() {
  T x = 0, w = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') w = -w;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * w;
}
template <class T>
inline T read(T& x) {
  return x = read<T>();
}
const int mod = 1000000000 + 7;
inline int add(int a, int b) { return (a += b) >= mod ? a - mod : a; }
inline int mul(int a, int b) { return (long long)a * b % mod; }
inline int fpow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, a = mul(a, a))
    if (b & 1) ans = mul(ans, a);
  return ans;
}
const int N = 1000000 + 10;
namespace PAM {
int str[N], n;
int last, tot;
int ch[N][26], trans[N][26], len[N], fa[N];
int diff[N], anc[N];
void init() {
  memset(str, -1, sizeof str), n = 0;
  last = tot = 1;
  len[0] = 0, len[1] = -1, fa[0] = fa[1] = 1;
  fill(trans[0], trans[0] + 26, 1);
  diff[0] = 0;
}
void extend(int c) {
  str[++n] = c;
  int p = last;
  if (str[n - len[p] - 1] != str[n]) p = trans[p][c];
  if (!ch[p][c]) {
    int cur = ++tot;
    len[cur] = len[p] + 2;
    fa[cur] = ch[trans[p][c]][c];
    ch[p][c] = cur;
    copy(trans[fa[cur]], trans[fa[cur]] + 26, trans[cur]);
    trans[cur][str[n - len[fa[cur]]]] = fa[cur];
    diff[cur] = len[cur] - len[fa[cur]];
    anc[cur] = diff[cur] == diff[fa[cur]] ? anc[fa[cur]] : fa[cur];
  }
  last = ch[p][c];
}
}  // namespace PAM
char tmp[N], str[N];
int dp[N], ans[N];
int main() {
  scanf("%s", tmp + 1);
  int n = strlen(tmp + 1);
  if (n & 1) return puts("0"), 0;
  for (int i = 1; i <= n; i += 2) str[i] = tmp[(i + 1) / 2];
  reverse(tmp + 1, tmp + n + 1);
  for (int i = 2; i <= n; i += 2) str[i] = tmp[i / 2];
  PAM::init();
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    PAM::extend(str[i] - 'a');
    for (int p = PAM::last; p; p = PAM::anc[p]) {
      dp[p] = ans[i - PAM::len[PAM::anc[p]] - PAM::diff[p]];
      if (PAM::anc[p] != PAM::fa[p]) dp[p] = add(dp[p], dp[PAM::fa[p]]);
      if (~i & 1) ans[i] = add(ans[i], dp[p]);
    }
  }
  printf("%d\n", ans[n]);
  return 0;
}