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 N = 1e6 + 10;
int n, fa[N], tr[N][26], len[N], d[N], pre[N], las, nodeid, dp[N], g[N];
char s[N], t[N];
void ins(int c, int m) {
  int u = las;
  while (t[m - len[u] - 1] != t[m]) u = fa[u];
  int now = tr[u][c];
  if (!now) {
    now = ++nodeid;
    int v = fa[u];
    while (t[m - len[v] - 1] != t[m]) v = fa[v];
    fa[now] = tr[v][c];
    tr[u][c] = now;
    len[now] = len[u] + 2;
    d[now] = len[now] - len[fa[now]];
    if (d[now] == d[fa[now]])
      pre[now] = pre[fa[now]];
    else
      pre[now] = fa[now];
  }
  las = now;
}
inline int M(const int &o) { return o >= 1000000007 ? o - 1000000007 : o; }
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (n & 1) return puts("0"), 0;
  for (int i = 1; (i << 1) <= n; i++)
    t[i * 2 - 1] = s[i], t[i * 2] = s[n - i + 1];
  fa[0] = fa[1] = 1, len[0] = 0, len[1] = -1, nodeid = 1;
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    ins(t[i] - 'a', i);
    for (int j = las; j > 1; j = pre[j]) {
      g[j] = dp[i - len[pre[j]] - d[j]];
      if (d[j] == d[fa[j]]) g[j] = M(g[j] + g[fa[j]]);
      if (!(i & 1)) dp[i] = M(dp[i] + g[j]);
    }
  }
  cout << dp[n] << endl;
  return 0;
}