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;
const int MAXN = 1000005;
const int MOD = 1e9 + 7;
template <typename T>
inline void read(T &AKNOI) {
  T x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  AKNOI = flag * x;
}
inline void Inc(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
char ss[MAXN], s[MAXN];
struct PAM {
  int tot, last, ch[MAXN][26], fa[MAXN], maxl[MAXN];
  int dif[MAXN], ff[MAXN], g[MAXN], dp[MAXN];
  void Extend(int x, int i) {
    int p = last;
    while (s[i - maxl[p] - 1] != s[i]) {
      p = fa[p];
    }
    if (!ch[p][x]) {
      int np = ++tot, q = fa[p];
      maxl[np] = maxl[p] + 2;
      while (s[i - maxl[q] - 1] != s[i]) {
        q = fa[q];
      }
      fa[np] = ch[q][x];
      ch[p][x] = np;
      dif[np] = maxl[np] - maxl[fa[np]];
      if (dif[np] == dif[fa[np]]) {
        ff[np] = ff[fa[np]];
      } else {
        ff[np] = fa[np];
      }
    }
    last = ch[p][x];
  }
  void solve() {
    scanf("%s", ss + 1);
    int n = strlen(ss + 1);
    if (n & 1) {
      printf("0\n");
      return;
    }
    for (int i = 1, j = n; i <= j; ++i, --j) {
      s[i * 2 - 1] = ss[i];
      s[i * 2] = ss[j];
    }
    fa[0] = fa[1] = tot = 1;
    maxl[1] = -1;
    dp[0] = 1;
    for (int i = 1; i <= n; ++i) {
      Extend(s[i] - 'a', i);
      for (int j = last; j; j = ff[j]) {
        g[j] = dp[i - maxl[ff[j]] - dif[j]];
        if (fa[j] ^ ff[j]) {
          Inc(g[j], g[fa[j]]);
        }
        if (!(i & 1)) {
          Inc(dp[i], g[j]);
        }
      }
    }
    printf("%d\n", dp[n]);
  }
} pam;
int main() {
  pam.solve();
  return 0;
}