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 = 1000000007;
struct Node {
  int t[26], len, f, tf, d, s;
} a[1000500];
int tn, las;
void linkd(int u) {
  int fa = a[u].f;
  a[u].d = a[u].len - a[fa].len;
  a[u].tf = (a[u].d == a[fa].d && a[u].d * 2 <= a[u].len) ? a[fa].tf : u;
}
void ins(int k, int c, char *str) {
  int p = las;
  while (str[k - a[p].len - 1] != c) p = a[p].f;
  if (!a[p].t[c]) {
    int np = las = ++tn, v;
    for (v = a[p].f; str[k - a[v].len - 1] != c; v = a[v].f)
      ;
    if (!a[v].t[c])
      a[np].f = 2;
    else
      a[np].f = a[v].t[c];
    a[a[p].t[c] = np].len = a[p].len + 2;
    linkd(np);
  } else
    las = a[p].t[c];
}
int f[1000500];
void dp(int k) {
  for (int p = las; p > 2; p = a[a[p].tf].f) {
    int tl = a[a[p].tf].len;
    a[p].s = f[k - tl];
    if (a[p].tf != p) a[p].s = (a[a[p].f].s + a[p].s) % mod;
    if (!(k & 1)) f[k] = (f[k] + a[p].s) % mod;
  }
}
void Init() {
  a[1].f = a[2].f = 1;
  a[1].len = -1;
  las = tn = 2;
}
int n;
char s[1000500], s2[1000500];
int main() {
  scanf("%s", s2 + 1);
  n = strlen(s2 + 1);
  if (n & 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i + i <= n; i++) {
    s[i * 2 - 1] = s2[n - i + 1];
    s[i * 2] = s2[i];
  }
  s[0] = -1;
  f[0] = 1;
  Init();
  for (int i = 1; i <= n; i++) {
    ins(i, s[i] -= 'a', s);
    dp(i);
  }
  printf("%d", f[n]);
  return 0;
}