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 mod = 1e9 + 7;
int n, f[1000005], g[1000005];
char s[1000005], s2[1000005];
namespace PAM {
int fa[1000005] = {1, 1}, ch[1000005][26], len[1000005] = {0, -1}, last, sz = 1,
    anc[1000005], dif[1000005];
void extend(int x) {
  int p = last, c = s[x] - 'a';
  while (s[x] != s[x - len[p] - 1]) p = fa[p];
  if (!ch[p][c]) {
    int q = fa[p];
    len[++sz] = len[p] + 2;
    while (s[x] != s[x - len[q] - 1]) q = fa[q];
    fa[sz] = ch[q][c], dif[sz] = len[sz] - len[fa[sz]];
    anc[sz] = dif[sz] == dif[fa[sz]] ? anc[fa[sz]] : fa[sz];
    ch[p][c] = sz;
  }
  last = ch[p][c];
}
}  // namespace PAM
using namespace PAM;
int main() {
  scanf("%s", s + 1), n = strlen(s + 1);
  for (int i = 1; i <= n; i += 2) s2[i] = s[(i + 1) / 2];
  for (int i = 2; i <= n; i += 2) s2[i] = s[n - i / 2 + 1];
  for (int i = 1; i <= n; i++) s[i] = s2[i];
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(i);
    for (int x = last; x; x = anc[x]) {
      g[x] = f[i - len[anc[x]] - dif[x]];
      if (anc[x] != fa[x]) g[x] = (g[x] + g[fa[x]]) % mod;
      if (!(i & 1)) f[i] = (f[i] + g[x]) % mod;
    }
  }
  printf("%d\n", f[n]);
}