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;
template <class T = int>
T read() {
  T x = 0;
  char ch = 0;
  bool f = false;
  while (!isdigit(ch)) f |= (ch = getchar()) == '-';
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ '0');
  return f ? -x : x;
}
const int MOD = 1e9 + 7;
int add(int a, int b) { return a + b < MOD ? a + b : a + b - MOD; }
void dadd(int &a, int b) { a = add(a, b); }
const int N = 1.1e6;
const int C = 26;
namespace PAM {
struct Node {
  int fa, ch[C];
  int len;
  int d, sf;
  int sans;
} o[N];
int ns = 0;
int ert = ++ns;
int ort = ++ns;
int last;
int ans[N];
void solve(const char *s) {
  o[ert].fa = ort;
  o[ort].len = -1;
  last = ort;
  ans[0] = 1;
  int i;
  for (i = 0; s[i]; i++) {
    int c = s[i] - 'a';
    int l = last;
    while (l && (o[l].len == i || s[i - o[l].len - 1] != s[i])) l = o[l].fa;
    if (o[l].ch[c])
      last = o[l].ch[c];
    else {
      o[l].ch[c] = ++ns;
      o[ns].len = o[l].len + 2;
      l = o[l].fa;
      while (l && (o[l].len == i || s[i - o[l].len - 1] != s[i])) l = o[l].fa;
      int f = o[l].ch[c];
      if (!f) f = ert;
      o[ns].fa = f;
      last = ns;
      o[ns].d = o[ns].len - o[f].len;
      o[ns].sf = o[ns].d == o[f].d ? o[f].sf : f;
    }
    int &a = ans[i + 1];
    a = 0;
    for (int l = last; o[l].len > 0; l = o[l].sf) {
      o[l].sans = ans[i + 1 - (o[o[l].sf].len + o[l].d)];
      if (o[l].sf != o[l].fa) {
        dadd(o[l].sans, o[o[l].fa].sans);
      }
      if (i % 2 == 1) dadd(a, o[l].sans);
    }
  }
  printf("%d\n", ans[i]);
}
}  // namespace PAM
char in[N];
char s[N];
int main() {
  scanf("%s", in);
  int n = strlen(in);
  for (int i = 0; i < (int)(n >> 1); i++) {
    s[i * 2] = in[i];
    s[i * 2 + 1] = in[n - 1 - i];
  }
  PAM::solve(s);
  return 0;
}