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 + 5;
char s[N], t[N];
int n;
void Init() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  int l = 1, r = n;
  int s0 = 0;
  while (l <= r) {
    s[++s0] = t[l++];
    if (l <= r) s[++s0] = t[r--];
  }
}
const int mo = 1e9 + 7;
long long f[N];
struct hwt {
  int n;
  int son[N][26], fa[N], len[N], tot, la;
  int dta[N], to[N];
  long long g[N];
  void build() {
    tot = 1;
    la = 0;
    fa[0] = fa[1] = 1;
    len[0] = 0;
    len[1] = -1;
    s[0] = -1;
  }
  int gf(int x) {
    while (s[n - len[x] - 1] != s[n]) x = fa[x];
    return x;
  }
  void add(int c) {
    n++;
    int p = gf(la);
    if (!son[p][c]) {
      int q = ++tot;
      len[q] = len[p] + 2;
      fa[q] = son[gf(fa[p])][c];
      son[p][c] = q;
      dta[q] = len[q] - len[fa[q]];
      to[q] = (dta[q] == dta[fa[q]] ? to[fa[q]] : fa[q]);
    }
    p = son[p][c];
    la = p;
    for (int x = la; x; x = to[x]) {
      g[x] = f[n - len[to[x]] - dta[x]];
      if (to[x] != fa[x]) g[x] = (g[x] + g[fa[x]]) % mo;
    }
  }
  long long calc() {
    long long ans = 0;
    for (int x = la; x; x = to[x]) {
      ans = (ans + g[x]) % mo;
    }
    return ans;
  }
} suf;
int main() {
  Init();
  suf.build();
  f[0] = 1;
  for (int i = 1, _b = n; i <= _b; i++) {
    suf.add(s[i] - 'a');
    f[i] = suf.calc();
    if (i & 1) f[i] = 0;
  }
  printf("%lld\n", f[n]);
}