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>
#pragma GCC optimize("O2")
#pragma G++ optimize("O2")
using namespace std;
const int N = 1111111;
const int M = 666666;
const int MOD = 1e9 + 7;
const int intINF = 1e9;
const long long llINF = 2e18;
const double pi = acos(-1.0);
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const double eps = 1e-10;
int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
long long readll() {
  long long v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
unsigned long long readull() {
  long long v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
char ch[N];
int m;
void predo() {}
void init() {
  scanf("%s", ch + 1);
  m = strlen(ch + 1);
}
int q, p, id, num[N], F[N], f[N], _f[N], len[N], sk[N], df[N], t[N][26];
int s[N], n;
struct pam {
  void add(int x, int n) {
    while (s[n - len[p] - 1] != s[n]) p = F[p];
    if (!t[p][x]) {
      int q = ++id, k = F[p];
      len[q] = len[p] + 2;
      while (s[n - len[k] - 1] != s[n]) k = F[k];
      F[q] = t[k][x];
      t[p][x] = q;
      df[q] = len[q] - len[F[q]];
      sk[q] = (df[q] == df[F[q]] ? sk[F[q]] : F[q]);
    }
    p = t[p][x];
  }
} pam;
void solve() {
  int i = 1, j = m;
  n = 0;
  while (n < m) {
    s[++n] = ch[i] - 'a';
    i++;
    s[++n] = ch[j] - 'a';
    j--;
  }
  s[0] = s[n + 1] = 114514;
  id = F[0] = 1;
  len[1] = -1;
  _f[0] = 1;
  f[0] = 1;
  for (int i = (int)1; i <= (int)n; i++) {
    pam.add(s[i], i);
    for (int x = p; x; x = sk[x]) {
      _f[x] = f[i - len[sk[x]] - df[x]];
      if (df[F[x]] == df[x]) _f[x] = (_f[x] + _f[F[x]]) % MOD;
      f[i] = (f[i] + _f[x]) % MOD;
    }
    if (i & 1) f[i] = 0;
  }
  printf("%d\n", f[n]);
}
int main() {
  predo();
  int cas = 1;
  while (cas--) {
    init();
    solve();
  }
  return 0;
}