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 N = 1e6 + 5, mod = 1e9 + 7;
using namespace std;
char s[N], t[N];
namespace PAM {
int dfn, las, top, tot;
int dif[N], bot[N], pos[N];
int f[N], g[N];
struct node {
  int len, fail, c[26];
} a[N];
int getfail(int x) {
  while (s[top] != s[top - a[x].len - 1]) x = a[x].fail;
  return x;
}
void extend(int k) {
  ++top;
  int cur = getfail(las);
  if (!a[cur].c[k]) {
    int now = ++tot;
    a[now].len = a[cur].len + 2;
    a[now].fail = a[getfail(a[cur].fail)].c[k];
    dif[now] = a[now].len - a[a[now].fail].len;
    bot[now] = dif[now] == dif[a[now].fail] ? bot[a[now].fail] : now;
    a[cur].c[k] = now;
  }
  las = a[cur].c[k];
}
void build(char *s) {
  int len = strlen(s + 1);
  las = tot = 1;
  top = 0;
  a[0].len = 0, a[1].len = -1;
  a[0].fail = a[1].fail = 1;
  for (int i = 1; i <= len; ++i) extend(s[i] - 'a'), pos[i] = las;
}
void solve(int n) {
  f[0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = pos[i]; j; j = a[bot[j]].fail) {
      int t = bot[j];
      if (t != j)
        g[j] = g[a[j].fail];
      else
        g[j] = 0;
      if (a[t].len) g[j] = (g[j] + f[i - a[t].len]) % mod;
      if (i % 2 == 0) f[i] = (f[i] + g[j]) % mod;
    }
  printf("%d\n", f[n]);
}
}  // namespace PAM
int main() {
  scanf("%s", t + 1);
  int len = strlen(t + 1);
  for (int i = 1; i <= len; ++i)
    s[i] = i % 2 == 0 ? t[len - i / 2 + 1] : t[i + 1 >> 1];
  PAM::build(s);
  PAM::solve(len);
  return 0;
}