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>
const int base = 26;
const int mod = 1e9 + 7;
const int MaxN = 1e6 + 5;
int n;
char s[MaxN], t[MaxN];
int ans[MaxN];
namespace PAM {
int lst, cur_n, nT = 1;
int fir[MaxN], del[MaxN], f[MaxN];
int trans[MaxN][base], len[MaxN], par[MaxN];
inline void init() {
  len[1] = -1;
  par[0] = par[1] = 1;
}
inline int find(int x) {
  while (s[cur_n] != s[cur_n - len[x] - 1]) x = par[x];
  return x;
}
inline void extend(int ch) {
  ++cur_n, ch -= 'a';
  int cur = find(lst);
  if (!trans[cur][ch]) {
    int x = ++nT;
    par[x] = trans[find(par[cur])][ch];
    len[trans[cur][ch] = x] = len[cur] + 2;
    del[x] = len[x] - len[par[x]];
    if (del[x] == del[par[x]])
      fir[x] = fir[par[x]];
    else
      fir[x] = x;
  }
  lst = trans[cur][ch];
}
}  // namespace PAM
inline void add(int &x, const int &y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  scanf("%s", t + 1);
  n = strlen(t + 1);
  int cur = 0;
  for (int i = 1; i <= (n >> 1); ++i) {
    s[++cur] = t[i];
    s[++cur] = t[n - i + 1];
  }
  using namespace PAM;
  init();
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    extend(s[i]);
    for (int x = lst; x; x = par[fir[x]]) {
      f[x] = ans[i - len[fir[x]]];
      if (fir[x] != x) add(f[x], f[par[x]]);
      if (~i & 1) add(ans[i], f[x]);
    }
  }
  std::cout << ans[n] << std::endl;
  return 0;
}