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, l, t, las, cnt, a[1000005], fail[1000005], len[1000005], h[1000005],
    g[1000005], f[1000005], ans[1000005], tr[1000005][28];
char s[1000005];
inline int get_fail(int x, int y) {
  while (a[x] != a[x - len[y] - 1]) y = fail[y];
  return y;
}
int main() {
  scanf("%s", s), n = strlen(s), l = n >> 1, fail[0] = ans[0] = cnt = 1,
                  len[1] = a[0] = -1;
  if (n & 1) {
    puts("0");
    return 0;
  }
  for (register int i = 0; i < l; ++i) a[(i << 1) | 1] = s[i] - 97;
  for (register int i = l; i < n; ++i) a[(n - i) << 1] = s[i] - 97;
  for (register int i = 1; i <= n; ++i) {
    t = get_fail(i, las);
    if (!tr[t][a[i]]) {
      fail[++cnt] = tr[get_fail(i, fail[t])][a[i]], len[cnt] = len[t] + 2,
      h[cnt] = len[cnt] - len[fail[cnt]], tr[t][a[i]] = cnt;
      if (h[cnt] == h[fail[cnt]])
        g[cnt] = g[fail[cnt]];
      else
        g[cnt] = fail[cnt];
    }
    las = tr[t][a[i]];
    for (register int j = las; j; j = g[j]) {
      f[j] = ans[i - len[g[j]] - h[j]];
      if (g[j] != fail[j]) f[j] = (f[j] + f[fail[j]]) % Mod;
      if (!(i & 1)) ans[i] = (ans[i] + f[j]) % Mod;
    }
  }
  printf("%d", ans[n]);
  return 0;
}