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>
inline void read(T& num) {
  num = 0;
  T f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') num = num * 10 + ch - '0', ch = getchar();
  num *= f;
}
inline int getgcd(int x, int y) {
  if (!x) return y;
  return getgcd(y % x, x);
}
inline int power(int x, int k, int p) {
  int res = 1;
  for (; k; k >>= 1, x = (long long)x * x % p)
    if (k & 1) res = (long long)res * x % p;
  return res;
}
const double pi = acos(-1);
inline void judge() { freopen("input.txt", "r", stdin); }
const int maxn = 1e6 + 5, mod = 1e9 + 7;
int cnt, lst, n;
char str[maxn], a[maxn];
int f[maxn], g[maxn], len[maxn], nxt[maxn][26], pre[maxn], anc[maxn],
    diff[maxn];
void extend(int n, int x) {
  while (a[n] != a[n - len[lst] - 1]) lst = pre[lst];
  if (nxt[lst][x])
    lst = nxt[lst][x];
  else {
    int now = pre[lst];
    while (a[n] != a[n - len[now] - 1]) now = pre[now];
    pre[++cnt] = nxt[now][x];
    nxt[lst][x] = cnt;
    len[cnt] = len[lst] + 2;
    diff[cnt] = len[cnt] - len[pre[cnt]];
    if (diff[cnt] == diff[pre[cnt]])
      anc[cnt] = anc[pre[cnt]];
    else
      anc[cnt] = pre[cnt];
    lst = cnt;
  }
}
int main() {
  scanf("%s", str + 1);
  n = strlen(str + 1);
  for (int(i) = (1); (i) <= (n / 2); (i)++)
    a[2 * i - 1] = str[i], a[2 * i] = str[n - i + 1];
  len[1] = -1;
  pre[1] = pre[0] = 1;
  cnt = 1;
  f[0] = 1;
  for (int(i) = (1); (i) <= (n); (i)++) {
    extend(i, a[i] - 'a');
    for (int tmp = lst; tmp; tmp = anc[tmp]) {
      g[tmp] = f[i - len[anc[tmp]] - diff[tmp]];
      if (diff[tmp] == diff[pre[tmp]]) g[tmp] = (g[tmp] + g[pre[tmp]]) % mod;
      f[i] = (f[i] + g[tmp]) % mod;
    }
    if (i & 1) f[i] = 0;
  }
  printf("%d\n", f[n]);
  return 0;
}