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>
namespace PAM {
char s[1000015];
int fail[1000015], cnt, n, len[1000015], diff[1000015], slink[1000015],
    s_f[1000015], c[1000015][26], lst;
void init() {
  fail[0] = 1;
  cnt = 1;
  len[1] = -1;
  s[0] = -1;
  n = 0;
}
int get(int x) {
  while (s[n] != s[n - len[x] - 1]) x = fail[x];
  return x;
}
int insert(int x) {
  s[++n] = x;
  lst = get(lst);
  if (!c[lst][x]) {
    len[++cnt] = len[lst] + 2;
    fail[cnt] = c[get(fail[lst])][x];
    diff[cnt] = len[cnt] - len[fail[cnt]];
    if (diff[cnt] == diff[fail[cnt]])
      slink[cnt] = slink[fail[cnt]];
    else
      slink[cnt] = fail[cnt];
    c[lst][x] = cnt;
  }
  return lst = c[lst][x];
}
}  // namespace PAM
inline void add(int &x, const int y) {
  if (x + y < 1000000007)
    x += y;
  else
    x += y - 1000000007;
}
int len, f[1000015];
char tp[1000015], s[1000015];
int main() {
  scanf("%s", tp + 1);
  len = strlen(tp + 1);
  for (int i = 1; i <= len / 2; i++)
    s[i * 2 - 1] = tp[i], s[i * 2] = tp[len - i + 1];
  PAM::init();
  f[0] = 1;
  for (int i = 1; i <= len; i++)
    for (int cur = PAM::insert(s[i] - 'a'); PAM::len[cur] > 0;
         cur = PAM::slink[cur]) {
      PAM::s_f[cur] = f[i - (PAM::len[PAM::slink[cur]] + PAM::diff[cur])];
      if (PAM::diff[cur] == PAM::diff[PAM::fail[cur]])
        add(PAM::s_f[cur], PAM::s_f[PAM::fail[cur]]);
      if (!(i & 1)) add(f[i], PAM::s_f[cur]);
    }
  printf("%d\n", f[len]);
}