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 = 1000010, mod = 1e9 + 7;
int ch[N][26], fa[N], g[N], f[N], tot, lst, nxt[N], l[N], s[N], dif[N], pos[N];
char t[N];
int read() {
  int x = 0;
  char c = getchar(), flag = '+';
  while (!isdigit(c)) flag = c, c = getchar();
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  return flag == '-' ? -x : x;
}
int Insert(int x, int c) {
  int p = lst;
  while (s[x - l[p] - 1] ^ c) p = fa[p];
  if (!ch[p][c]) {
    int now = ++tot, q = fa[p];
    l[now] = l[p] + 2;
    while (s[x - l[q] - 1] ^ c) q = fa[q];
    int t = ch[q][c];
    dif[now] = l[now] - l[t];
    fa[now] = t;
    if (dif[now] == dif[t])
      nxt[now] = nxt[t];
    else
      nxt[now] = t;
    ch[p][c] = now;
  }
  return lst = ch[p][c];
}
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  for (int i = 1; i <= n; i++) {
    if (i & 1)
      s[i] = t[i + 1 >> 1] - 'a';
    else
      s[i] = t[n - i / 2 + 1] - 'a';
  }
  s[0] = -1;
  tot = 1, l[1] = -1, fa[0] = 1;
  for (int i = 1; i <= n; i++) pos[i] = Insert(i, s[i]);
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int x = pos[i]; x; x = nxt[x]) {
      g[x] = f[i - l[nxt[x]] - dif[x]];
      if (dif[x] == dif[fa[x]])
        g[x] = g[x] + g[fa[x]] >= mod ? g[x] + g[fa[x]] - mod : g[x] + g[fa[x]];
      if (!(i & 1)) f[i] = f[i] + g[x] >= mod ? f[i] + g[x] - mod : f[i] + g[x];
    }
  }
  cout << f[n];
  return 0;
}