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 MAXN = 1000005;
const int N = 26;
long long f[MAXN], g[MAXN];
const long long mod = 1e9 + 7;
struct Palindromic_Tree {
  int next[MAXN][N];
  int fail[MAXN];
  int cnt[MAXN];
  int num[MAXN];
  int len[MAXN];
  int S[MAXN];
  int last;
  int n;
  int p;
  int delta[MAXN], start[MAXN];
  int newnode(int l) {
    for (int i = 0; i < N; ++i) next[p][i] = 0;
    cnt[p] = 0;
    num[p] = 0;
    len[p] = l;
    return p++;
  }
  void init() {
    p = 0;
    newnode(0);
    newnode(-1);
    last = 0;
    n = 0;
    S[n] = -1;
    fail[0] = 1;
  }
  int get_fail(int x) {
    while (S[n - len[x] - 1] != S[n]) x = fail[x];
    return x;
  }
  void add(int i, int c) {
    c -= 'a';
    S[++n] = c;
    int cur = get_fail(last);
    if (!next[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = next[get_fail(fail[cur])][c];
      next[cur][c] = now;
      num[now] = num[fail[now]] + 1;
      delta[now] = len[now] - len[fail[now]];
      if (delta[now] == delta[fail[now]])
        start[now] = start[fail[now]];
      else
        start[now] = now;
    }
    last = next[cur][c];
    for (int j = last; j >= 1; j = fail[start[j]]) {
      g[j] = f[i - len[start[j]]];
      if (start[j] != j) g[j] = (g[j] + g[fail[j]]) % mod;
      if (i % 2 == 0) f[i] = (f[i] + g[j]) % mod;
    }
    cnt[last]++;
  }
  void count() {
    for (int i = p - 1; i >= 0; --i) cnt[fail[i]] += cnt[i];
  }
} P;
char s[MAXN], str[MAXN];
int main() {
  scanf("%s", str);
  int n = strlen(str);
  int num = 0;
  for (int i = 1; i <= n; i += 2) s[i] = str[num++];
  num = n - 1;
  for (int i = 2; i <= n; i += 2) s[i] = str[num--];
  f[0] = 1;
  P.init();
  for (int i = 1; i <= n; i++) {
    P.add(i, s[i]);
  }
  printf("%lld", f[n]);
}