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 long long MOD = 1e9 + 7;
const double eps = 1e-10;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 1e6 + 5;
char s[MAXN];
char str[MAXN];
long long f[MAXN];
long long g[MAXN];
const int N = 26;
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 dif[MAXN];
  int id[MAXN];
  int go[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 c) {
    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;
      dif[now] = len[now] - len[fail[now]];
      go[now] = dif[now] == dif[fail[now]] ? go[fail[now]] : fail[now];
    }
    id[n] = last = next[cur][c];
    cnt[last]++;
  }
  void solve() {
    for (int i = 1; i <= n; i++) {
      int idx = id[i];
      int cnt = 0;
      for (int j = idx; j; j = go[j]) {
        cnt++;
        g[j] = f[i - len[go[j]] - dif[j]];
        if (dif[j] == dif[fail[j]]) g[j] = (g[j] + g[fail[j]]) % MOD;
        if (i % 2 == 0) f[i] = (f[i] + g[j]) % MOD;
      }
    }
  }
} PAM;
int main() {
  PAM.init();
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  if (n & 1) return 0 * puts("0");
  int cnt = 0;
  for (int i = 1; i <= n / 2; i++) {
    str[++cnt] = s[i];
    str[++cnt] = s[n - i + 1];
  }
  for (int i = 1; i <= n; i++) PAM.add(str[i] - 'a');
  f[0] = 1;
  PAM.solve();
  printf("%lld\n", f[n]);
  return 0;
}