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 + 10;
const int mod = 1e9 + 7;
char s[N], t[N], S[N];
int n, go[N][26], len[N], par[N], top, last;
int New(int L) {
  len[++top] = L;
  return top;
}
int diff[N], slink[N];
void extend(int n) {
  int w = S[n], p = last;
  while (S[n - len[p] - 1] != w) p = par[p];
  if (!go[p][w - 'a']) {
    int q = New(len[p] + 2), now = p;
    do now = par[now];
    while (S[n - len[now] - 1] != w);
    par[q] = go[now][w - 'a'];
    go[p][w - 'a'] = q;
    diff[q] = len[q] - len[par[q]];
    slink[q] = (diff[q] == diff[par[q]] ? slink[par[q]] : par[q]);
  }
  last = go[p][w - 'a'];
}
int ans[N], from[N], _ans[N], sum[N];
char kek[N];
int main() {
  scanf("%s", kek + 1);
  int n = strlen(kek + 1);
  for (int i = 1; i <= n / 2; i++) s[i] = kek[i];
  for (int i = 1; i <= n / 2; i++) t[i] = kek[n - i + 1];
  n /= 2;
  for (int i = 1; i <= n; i++) S[i * 2 - 1] = s[i], S[i * 2] = t[i];
  par[0] = top = 1;
  len[1] = -1;
  n *= 2;
  for (int i = 1; i <= n; i++) ans[i] = 0;
  _ans[0] = 1;
  ans[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(i);
    for (int p = last; p; p = slink[p]) {
      _ans[p] = i - (len[slink[p]] + diff[p]);
      sum[p] = ans[_ans[p]];
      int cur = p;
      if (diff[par[cur]] == diff[cur]) {
        sum[cur] += sum[par[cur]];
        if (sum[cur] >= mod) sum[cur] -= mod;
      }
      if (!(i & 1)) {
        ans[i] += sum[cur];
        if (ans[i] >= mod) ans[i] -= mod;
      }
    }
  }
  cout << ans[n] << '\n';
}