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, maxk = 27, mod = 1000000007;
int n;
int f[maxn];
string s, ss;
struct Palindrome_AutoMaton {
  int slen, tot, last;
  int chd[maxn][maxk], fail[maxn], len[maxn], dif[maxn], slink[maxn], sum[maxn];
  string s;
  int getfail(int x, int i) {
    while (i - len[x] - 1 < 0 || s[i - len[x] - 1] != s[i]) x = fail[x];
    return x;
  }
  int insert(int last, int x, int i) {
    int pos = getfail(last, i);
    if (chd[pos][x] == 0) {
      tot++, fail[tot] = chd[getfail(fail[pos], i)][x];
      chd[pos][x] = tot, len[tot] = len[pos] + 2;
      dif[tot] = len[tot] - len[fail[tot]];
      if (dif[tot] == dif[fail[tot]])
        slink[tot] = slink[fail[tot]];
      else
        slink[tot] = fail[tot];
    }
    return chd[pos][x];
  }
  void init(int klen, string k) {
    memset(chd, 0, sizeof(chd));
    memset(fail, 0, sizeof(fail));
    memset(len, 0, sizeof(len));
    memset(sum, 0, sizeof(sum));
    memset(dif, 0, sizeof(dif));
    memset(slink, 0, sizeof(slink));
    s = k, slen = klen, tot = 1;
    fail[0] = 1, fail[1] = 0, len[0] = 0, len[1] = -1;
  }
  void dp() {
    last = 0;
    f[0] = 1;
    for (int i = 1; i <= slen; i++) {
      last = insert(last, s[i] - 96, i);
      for (int pos = last; pos > 1; pos = slink[pos]) {
        sum[pos] = f[i - (len[slink[pos]] + dif[pos])];
        if (dif[pos] == dif[fail[pos]])
          sum[pos] = (sum[pos] + sum[fail[pos]]) % mod;
        if (i % 2 == 0) f[i] = (f[i] + sum[pos]) % mod;
      }
    }
  }
} PAM;
int main() {
  cin >> s;
  if ((int)(s.size()) % 2 == 1) {
    puts("0");
    return 0;
  }
  n = s.size(), s = " " + s;
  for (int i = 1; i <= n / 2; i++) ss += s[i], ss += s[n - i + 1];
  ss = " " + ss;
  PAM.init(n, ss);
  PAM.dp();
  printf("%d\n", f[s.size() - 1]);
  return 0;
}