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>
char s[2000005], ss[2000005];
int n, ans[2000005];
int read() {
  char c = getchar();
  int ans = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans;
}
void Write(int x) {
  if (x < 10)
    putchar(x ^ 48);
  else
    Write(x / 10), putchar((x % 10) ^ 48);
  return;
}
int add(int x, int y) { return (x += y) >= 1000000007 ? x - 1000000007 : x; }
int sub(int x, int y) { return (x -= y) < 0 ? x + 1000000007 : x; }
namespace PAM {
int son[2000005][26], len[2000005], anc[2000005], diff[2000005], sum[2000005],
    fail[2000005], last, cnt;
void init() {
  len[1] = -1, len[0] = 0, fail[0] = 1, fail[1] = 0, last = cnt = 1;
  return;
}
int get_fail(int x, int p) {
  while (s[p - len[x] - 1] != s[p]) x = fail[x];
  return x;
}
void Insert(int x, int p) {
  int now = get_fail(last, p);
  if (!son[now][x])
    len[++cnt] = len[now] + 2, fail[cnt] = son[get_fail(fail[now], p)][x],
    son[now][x] = cnt, diff[cnt] = len[cnt] - len[fail[cnt]],
    anc[cnt] = (diff[cnt] == diff[fail[cnt]] ? anc[fail[cnt]] : fail[cnt]);
  return (void)(last = son[now][x]);
}
}  // namespace PAM
int main() {
  PAM::init();
  scanf("%s", ss + 1);
  n = strlen(ss + 1);
  for (register int i = 1; i <= n; i += 2) s[i] = ss[(i + 1) / 2];
  std::reverse(ss + 1, ss + 1 + n);
  for (register int i = 2; i <= n; i += 2) s[i] = ss[i / 2];
  ans[0] = 1;
  for (register int i = 1; i <= n; i++) {
    PAM::Insert(s[i] - 'a', i);
    for (register int j = PAM::last; j; j = PAM::anc[j]) {
      PAM::sum[j] = ans[i - PAM::len[PAM::anc[j]] - PAM::diff[j]];
      if (PAM::anc[j] != PAM::fail[j])
        PAM::sum[j] = add(PAM::sum[j], PAM::sum[PAM::fail[j]]);
      if (!(i & 1)) ans[i] = add(ans[i], PAM::sum[j]);
    }
  }
  Write(ans[n]);
  return 0;
}