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;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int n, las, tot, cnt;
int len[2000010], fail[2000010], ch[2000010][26], slink[2000010], diff[2000010],
    f[2000010], g[2000010];
char s[2000010], str[2000010];
void init() { len[1] = -1, fail[0] = fail[1] = tot = 1; }
void insert(int i) {
  int p = las, c = s[i] - 'a';
  while (s[i - 1 - len[p]] != s[i]) p = fail[p];
  if (ch[p][c]) {
    las = ch[p][c];
    return;
  }
  int x = fail[p], y = ++tot;
  while (s[i - 1 - len[x]] != s[i]) x = fail[x];
  fail[y] = ch[x][c], len[y] = len[p] + 2, ch[p][c] = las = y,
  diff[y] = len[y] - len[fail[y]];
  if (diff[y] == diff[fail[y]])
    slink[y] = slink[fail[y]];
  else
    slink[y] = fail[y];
}
int main() {
  init(), scanf("%s", str + 1), n = strlen(str + 1), f[0] = 1;
  for (int i = 1; i <= 2 * n; i += 2) s[i] = str[++cnt];
  for (int i = 2; i <= 2 * n; i += 2) s[i] = str[cnt--];
  for (int i = 1; i <= n; ++i) {
    insert(i);
    for (int p = las; p; p = slink[p]) {
      g[p] = f[i - len[slink[p]] - diff[p]];
      if (slink[p] != fail[p]) g[p] = (g[p] + g[fail[p]]) % 1000000007;
      if (!(i & 1)) f[i] = (f[i] + g[p]) % 1000000007;
    }
  }
  printf("%d", f[n]);
  return 0;
}