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 CN = 26;
int nxt[MAXN][CN];
int fail[MAXN];
int cnt[MAXN];
int num[MAXN];
int len[MAXN];
int s[MAXN];
int diff[MAXN];
int slink[MAXN];
int sans[MAXN];
int last;
int n;
int p;
int newnode(int l) {
  for (int i = 0; i < CN; ++i) nxt[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) {
  c -= 'a';
  s[++n] = c;
  int cur = get_fail(last);
  if (!nxt[cur][c]) {
    int now = newnode(len[cur] + 2);
    fail[now] = nxt[get_fail(fail[cur])][c];
    nxt[cur][c] = now;
    num[now] = num[fail[now]] + 1;
    diff[now] = len[now] - len[fail[now]];
    if (diff[now] == diff[fail[now]])
      slink[now] = slink[fail[now]];
    else
      slink[now] = fail[now];
  }
  last = nxt[cur][c];
  cnt[last]++;
}
void count() {
  for (int i = p - 1; i >= 0; --i) cnt[fail[i]] += cnt[i];
}
char s1[MAXN];
char s2[MAXN];
const int N = 1000005, mo = 1e9 + 7;
int f[N];
int m;
int main() {
  scanf("%s", s1 + 1);
  int slen = strlen(s1 + 1);
  for (int i = 1, j = slen; i <= j; i++, j--) {
    s2[++m] = s1[i];
    if (j != i) s2[++m] = s1[j];
  }
  s2[m + 1] = 0;
  init();
  f[0] = 1;
  for (int i = 1; i <= m; i++) {
    add(s2[i]);
    for (int v = last; len[v] > 0; v = slink[v]) {
      int pos = i - (len[slink[v]] + diff[v]);
      sans[v] = f[pos];
      if (diff[v] == diff[fail[v]]) sans[v] = (sans[v] + sans[fail[v]]) % mo;
      f[i] = (f[i] + sans[v]) % mo;
    }
    if (i & 1) f[i] = 0;
  }
  printf("%d\n", f[m]);
}