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 N = 1e6 + 5, mod = 1e9 + 7;
char t[N], s[N];
inline int add(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
inline void inc(int& x, int y) { x = add(x, y); }
namespace PAM {
int last, tot, len[N], fail[N], dif[N], slink[N], ch[N][26];
inline void pre() {
  tot = 1;
  len[0] = 0, len[1] = -1;
  fail[1] = 1, fail[0] = 1;
  last = 0;
}
inline void nd(int x, int p, int c) {
  ch[p][c] = ++tot;
  len[tot] = len[p] + 2;
  if (p == 1)
    fail[tot] = 0;
  else {
    p = fail[p];
    while (s[x] != s[x - len[p] - 1]) p = fail[p];
    fail[tot] = ch[p][c];
  }
  dif[tot] = len[tot] - len[fail[tot]];
  if (dif[tot] != dif[fail[tot]])
    slink[tot] = fail[tot];
  else
    slink[tot] = slink[fail[tot]];
}
inline void extend(int x, int c) {
  int p = last;
  while (s[x] != s[x - len[p] - 1]) p = fail[p];
  if (!ch[p][c]) nd(x, p, c);
  last = ch[p][c];
}
}  // namespace PAM
using namespace PAM;
int f[N], g[N];
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  if (n & 1) {
    puts("0");
    return 0;
  }
  for (int i = 1, l = 1, r = n; l <= r; ++i) s[i] = (i & 1) ? t[l++] : t[r--];
  f[0] = 1;
  pre();
  for (int i = 1; i <= n; ++i) {
    extend(i, s[i] - 'a');
    for (int p = last; p; p = slink[p]) {
      g[p] = f[i - len[slink[p]] - dif[p]];
      if (slink[p] != fail[p]) inc(g[p], g[fail[p]]);
      if (!(i & 1)) inc(f[i], g[p]);
    }
  }
  printf("%d\n", f[n]);
  return 0;
}