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>
class Palindrome_Automaton {
 private:
  static const int MAXS = 1e6, MOD = 1e9 + 7;
  int Cnt, Last, Aux[MAXS + 5], F[MAXS + 5], Dif[MAXS + 5], Anc[MAXS + 5];
  struct Node {
    int L, Fa, Ch[26];
    Node() {}
    Node(const int l, const int f = 0) {
      L = l, Fa = f;
      for (register int i = 0; i ^ 26; ++i) Ch[i] = 0;
    }
  } nd[MAXS + 5];

 public:
  inline void Init() {
    for (register int i = 1; i <= Cnt; ++i) nd[i] = Node(0);
    Cnt = Last = F[0] = 1;
    nd[0] = Node(0, 1), nd[1] = Node(-1, 0);
  }
  inline int NewNode() {
    nd[++Cnt] = Node(0);
    return Cnt;
  }
  inline int Extend(char* S) {
    int l = strlen(S + 1);
    for (register int i = 1; i <= l; ++i) {
      int c = S[i] - 'a', p = Last;
      for (; S[i] ^ S[i - nd[p].L - 1]; p = nd[p].Fa)
        ;
      if (!nd[p].Ch[c]) {
        int Cur = NewNode(), q = nd[p].Fa;
        nd[Cur].L = nd[p].L + 2;
        for (; S[i] ^ S[i - nd[q].L - 1]; q = nd[q].Fa)
          ;
        nd[Cur].Fa = nd[q].Ch[c], nd[p].Ch[c] = Cur;
        Dif[Cur] = nd[Cur].L - nd[nd[Cur].Fa].L;
        Anc[Cur] = Dif[Cur] == Dif[nd[Cur].Fa] ? Anc[nd[Cur].Fa] : nd[Cur].Fa;
      }
      for (p = Last = nd[p].Ch[c]; p; p = Anc[p]) {
        Aux[p] = F[i - nd[Anc[p]].L - Dif[p]];
        if (Anc[p] ^ nd[p].Fa) Aux[p] = (Aux[p] + Aux[nd[p].Fa]) % MOD;
        if (!(i & 1)) F[i] = (F[i] + Aux[p]) % MOD;
      }
    }
    return F[l];
  }
};
const int MAXL = 1e6;
char tmp[MAXL + 5], S[MAXL + 5];
Palindrome_Automaton PAM;
inline void Work() {
  scanf("%s", tmp);
  int l = strlen(tmp);
  for (register int i = 0; i ^ l; ++i)
    S[i < l >> 1 ? i << 1 | 1 : (l << 1) - (i << 1)] = tmp[i];
  PAM.Init();
  printf("%d\n", PAM.Extend(S));
}
int main() {
  Work();
  return 0;
}