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>
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + (c - '0'), c = getchar();
  return f * x;
}
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
template <typename T>
bool umax(T& a, T t) {
  if (t > a) return a = t, 1;
  return 0;
}
template <typename T>
bool umin(T& a, T t) {
  if (t < a) return a = t, 1;
  return 0;
}
const int MAXN = 1000011, mod = 1e9 + 7;
inline int S(int x) { return x < mod ? x : x - mod; }
char s[MAXN], tp[MAXN];
int f[MAXN], ed[MAXN];
namespace PTree {
int t[MAXN][26], fail[MAXN], len[MAXN], top[MAXN], sig[MAXN];
int last, tot, now;
void init() { last = tot = 1, len[0] = -1, top[0] = 0; }
int extend(int w) {
  int pos = last;
  while (pos && s[now - len[pos]] - 'a' != w) pos = fail[pos];
  if (!t[pos][w]) {
    t[pos][w] = ++tot, len[tot] = len[pos] + 2;
    if (!pos)
      fail[tot] = 1, top[tot] = tot;
    else {
      pos = fail[pos];
      while (pos && s[now - len[pos]] - 'a' != w) pos = fail[pos];
      fail[tot] = t[pos][w];
      top[tot] =
          (len[tot] - len[fail[tot]] == len[fail[tot]] - len[fail[fail[tot]]]
               ? top[fail[tot]]
               : tot);
    }
    last = tot;
  } else
    last = t[pos][w];
  ++now;
  return last;
}
void solve() {
  int n = now;
  f[0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int x = ed[i]; x > 1; x = fail[top[x]]) {
      sig[x] =
          top[x] == x ? f[i - len[x]] : S(sig[fail[x]] + f[i - len[top[x]]]);
      if (!(i & 1)) f[i] = S(f[i] + sig[x]);
    }
  printf("%d\n", f[n]);
}
}  // namespace PTree
int main() {
  scanf("%s", tp + 1);
  int n = strlen(tp + 1);
  for (int i = 1; i <= (n >> 1); ++i) s[2 * i - 1] = tp[i];
  for (int i = n; i > (n >> 1); --i) s[2 * (n - i + 1)] = tp[i];
  PTree::init();
  for (int i = 1; i <= n; ++i) ed[i] = PTree::extend(s[i] - 'a');
  PTree::solve();
  return 0;
}