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;
inline int read() {
  char ch = getchar();
  int w = 1, c = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') w = -1;
  for (; isdigit(ch); ch = getchar()) c = (c << 1) + (c << 3) + (ch ^ 48);
  return w * c;
}
const int M = 1e6 + 10, mod = 1e9 + 7;
char s[M], hry[M];
int n, fa[M], len[M], tot, lst, del[M], slink[M], t[M][26];
void init() {
  fa[1] = fa[0] = 1;
  len[1] = -1;
  tot = 1;
  lst = 1;
}
int gt(int x, int id) {
  for (; hry[id] ^ hry[id - len[x] - 1]; x = fa[x])
    ;
  return x;
}
void extend(int id) {
  int p = gt(lst, id), o = hry[id] - 'a';
  if (!t[p][o]) {
    int np = ++tot;
    fa[np] = t[gt(fa[p], id)][o];
    t[p][o] = np;
    len[np] = len[p] + 2;
    del[np] = len[np] - len[fa[np]];
    if (del[np] != del[fa[np]])
      slink[np] = fa[np];
    else
      slink[np] = slink[fa[np]];
  }
  lst = t[p][o];
}
long long ans[M], f[M];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (n & 1) {
    cout << 0 << "\n";
    return 0;
  }
  int o = 0;
  for (int i = (1); i <= (n / 2); ++i) {
    hry[++o] = s[i];
    hry[++o] = s[n - i + 1];
  }
  init();
  ans[0] = 1;
  for (int i = (1); i <= (n); ++i) {
    extend(i);
    for (int x = lst; x; x = slink[x]) {
      f[x] = ans[i - len[slink[x]] - del[x]];
      if (del[x] == del[fa[x]]) f[x] = (f[x] + f[fa[x]]) % mod;
      if (i % 2 == 0) ans[i] = (ans[i] + f[x]) % mod;
    }
  }
  cout << ans[n] << "\n";
  return 0;
}