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 N = 1e6 + 10;
const int mod = 1e9 + 7;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int ch[N][26], fail[N], len[N], tot = 0, now = 0, anc[N], diff[N], g[N], f[N];
char s[N], t[N];
void extend(int c, int n) {
  while (s[n - len[now] - 1] != s[n]) now = fail[now];
  if (!ch[now][c]) {
    int v = ++tot;
    len[v] = len[now] + 2;
    int k = fail[now];
    while (s[n - len[k] - 1] != s[n]) k = fail[k];
    fail[v] = ch[k][c];
    ch[now][c] = v;
    diff[v] = len[v] - len[fail[v]];
    anc[v] = (diff[v] == diff[fail[v]]) ? anc[fail[v]] : fail[v];
  }
  now = ch[now][c];
}
int main() {
  scanf("%s", t);
  int n = strlen(t);
  for (int i = 1, p = 0; i <= n; i += 2, p++) s[i] = t[p];
  for (int i = 2, p = n - 1; i <= n; i += 2, p--) s[i] = t[p];
  s[n + 1] = '\0';
  f[0] = 1;
  len[++tot] = -1;
  fail[0] = fail[1] = 1;
  for (int i = 1; i <= n; i++) {
    extend(s[i] - 'a', i);
    for (int k = now; k > 1; k = anc[k]) {
      g[k] = f[i - len[anc[k]] - diff[k]];
      if (anc[k] != fail[k]) g[k] = (g[k] + g[fail[k]]) % mod;
      if (!(i & 1)) f[i] = (f[i] + g[k]) % mod;
    }
  }
  printf("%d\n", f[n]);
  return 0;
}