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;
int ch[1234567][26], len[1234567], fail[1234567], s[1234567], cl, an, lst,
    sf[1234567], df[1234567];
int addn(int l) {
  len[an] = l;
  return an++;
}
void init() {
  cl = an = lst = 0;
  addn(0);
  addn(-1);
  fail[0] = 1;
  s[0] = -233;
}
int gfail(int x, int l) {
  while (s[l - len[x] - 1] != s[l]) x = fail[x];
  return x;
}
void add(int c) {
  c -= 'a';
  s[++cl] = c;
  int cp = gfail(lst, cl);
  if (!ch[cp][c]) {
    int nn = addn(len[cp] + 2);
    fail[nn] = ch[gfail(fail[cp], cl)][c];
    ch[cp][c] = nn;
  }
  lst = ch[cp][c];
  df[lst] = len[lst] - len[fail[lst]];
  sf[lst] = (df[lst] == df[fail[lst]]) ? sf[fail[lst]] : fail[lst];
}
int ans[1234567], la[1234567];
const int MOD = 1e9 + 7;
char str[1234567], sc[1234567];
int main() {
  scanf("%s", str + 1);
  init();
  int n = strlen(str + 1), g = 0;
  for (int i = 1; i <= n + 1 - i; i++)
    sc[++g] = str[i], sc[++g] = str[n + 1 - i];
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    add(sc[i]);
    for (int j = lst; len[j] > 0; j = sf[j]) {
      la[j] = ans[i - (len[sf[j]] + df[j])];
      if (sf[j] != fail[j]) (la[j] += la[fail[j]]) %= MOD;
      if (i % 2 == 0) (ans[i] += la[j]) %= MOD;
    }
  }
  printf("%d\n", ans[n]);
}