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 = 1e6 + 5;
const int mod = 1e9 + 7;
char s[maxn], t[maxn];
int nxt[maxn][26], fail[maxn], anc[maxn], diff[maxn], len[maxn];
int last, tot;
int g[maxn], dp[maxn];
void init() {
  memset(s, -1, sizeof(s));
  tot = 1;
  last = 0;
  fail[0] = 1;
  len[1] = -1;
}
void extend(char x, int idx) {
  static auto get = [&](int now) -> int {
    while (s[idx - len[now] - 1] != x) {
      if (s[idx - len[fail[now]] - 1] == x) {
        now = fail[now];
        break;
      } else
        now = anc[now];
    }
    return now;
  };
  int p = get(last);
  if (!nxt[p][x]) {
    len[++tot] = len[p] + 2;
    fail[tot] = nxt[get(fail[p])][x];
    diff[tot] = len[tot] - len[fail[tot]];
    anc[tot] = diff[tot] == diff[fail[tot]] ? anc[fail[tot]] : fail[tot];
    nxt[p][x] = tot;
  }
  last = nxt[p][x];
  for (int i = last; i > 1; i = anc[i]) {
    g[i] = dp[idx - len[anc[i]] - diff[i]];
    if (diff[i] == diff[fail[i]]) {
      g[i] += g[fail[i]];
      g[i] %= mod;
    }
    dp[idx] += (idx % 2 == 0) * g[i];
    dp[idx] %= mod;
  }
}
int main() {
  init();
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  int tot = 0;
  for (int i = 1; i <= n / 2; ++i) {
    s[++tot] = t[i];
    s[++tot] = t[n - i + 1];
  }
  s[tot + 1] = 0;
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    extend(s[i], i);
  }
  cout << dp[n] << endl;
  return 0;
}