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;
int n, K;
struct PAM {
  struct node {
    int ch[26];
    int len, fail;
    int dif, slink;
  } t[2000000 + 5];
  int ptr = 0, last = 0;
  char *str;
  void ini(char *in) {
    str = in;
    ptr = 1;
    (t[0].fail) = 1;
    (t[1].len) = -1;
  }
  int get_fail(int x, int n) {
    while (str[n - (t[x].len) - 1] != str[n]) x = (t[x].fail);
    return x;
  }
  void insert(int c, int pos) {
    int p = get_fail(last, pos);
    if (!t[p].ch[c]) {
      int cur = ++ptr;
      (t[cur].len) = (t[p].len) + 2;
      (t[cur].fail) = t[get_fail((t[p].fail), pos)].ch[c];
      t[cur].dif = (t[cur].len) - (t[(t[cur].fail)].len);
      if (t[cur].dif == t[(t[cur].fail)].dif)
        t[cur].slink = t[(t[cur].fail)].slink;
      else
        t[cur].slink = (t[cur].fail);
      t[p].ch[c] = cur;
    }
    last = t[p].ch[c];
  }
  int dp[2000000 + 5], g[2000000 + 5];
  int solve() {
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
      insert(str[i] - 'a', i);
      for (int x = last; x > 1; x = t[x].slink) {
        g[x] = dp[i - (t[t[x].slink].len) - t[x].dif];
        if (t[x].dif == t[(t[x].fail)].dif)
          g[x] = (g[x] + g[(t[x].fail)]) % 1000000007;
        if (i % 2 == 0) dp[i] = (dp[i] + g[x]) % 1000000007;
      }
    }
    return dp[n];
  }
} T;
char s[2000000 + 5], t[2000000 + 5];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1, ptr = 0; i <= n / 2; i++) {
    t[++ptr] = s[i];
    t[++ptr] = s[n - i + 1];
  }
  T.ini(t);
  printf("%d\n", T.solve());
}