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 inf = 0x3f3f3f3f;
const long long lnf = 0x3f3f3f3f3f3f3f3f;
const double dnf = 1e18;
const int mod = 1e9 + 7;
const double eps = 1e-5;
const double pi = acos(-1.0);
const int hp = 13331;
const int maxn = 1000100;
const int maxp = 1100;
const int maxm = 4000100;
const int up = 1000;
const int N = 26;
struct Palindromic_Tree {
  int t[maxn][N];
  int fail[maxn];
  int cnt[maxn];
  int num[maxn];
  int len[maxn];
  int S[maxn];
  int di[maxn];
  int pre[maxn];
  int last;
  int n;
  int p;
  int newnode(int l) {
    for (int i = 0; i < N; ++i) t[p][i] = 0;
    cnt[p] = 0;
    num[p] = 0;
    len[p] = l;
    return p++;
  }
  void init(void) {
    p = 0;
    newnode(0);
    newnode(-1);
    last = 0;
    n = 0;
    S[n] = -1;
    fail[0] = 1;
    pre[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 (!t[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = t[get_fail(fail[cur])][c];
      t[cur][c] = now;
      num[now] = num[fail[now]] + 1;
      di[now] = len[now] - len[fail[now]];
      pre[now] = (di[now] == di[fail[now]]) ? pre[fail[now]] : fail[now];
    }
    last = t[cur][c];
    cnt[last]++;
  }
  void _count(void) {
    for (int i = p - 1; i >= 0; --i) cnt[fail[i]] += cnt[i];
  }
} pam;
int dp[maxn], g[maxn];
char str[maxn], s[maxn];
int main(void) {
  scanf("%s", str + 1);
  int n = strlen(str + 1);
  if (n & 1) {
    printf("0\n");
    return 0;
  }
  int cnt = 0;
  int l = 1, r = n;
  for (int i = 1; i <= n / 2; i++) s[++cnt] = str[l++], s[++cnt] = str[r--];
  pam.init();
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    pam.add(s[i]);
    for (int p = pam.last; p != 1 && p != 0; p = pam.pre[p]) {
      g[p] = dp[i - pam.len[pam.pre[p]] - pam.di[p]];
      if (pam.fail[p] != pam.pre[p]) g[p] = (g[p] + g[pam.fail[p]]) % mod;
      if (i % 2 == 0) dp[i] = (dp[i] + g[p]) % mod;
    }
  }
  printf("%d\n", dp[n]);
  return 0;
}