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 long long mod = 1e9 + 7;
template <typename T>
inline void Add(T &x, T y) {
  x += y;
  if (x >= mod) x -= mod;
}
namespace PAM {
int ne[1000010][26], fail[1000010], len[1000010], las, cnt, n, d[1000010],
    anc[1000010], t[1000010];
long long info[1000010];
void init() {
  t[n = 0] = -1;
  len[cnt = 1] = -1;
  fail[las = 0] = 1;
}
inline int getfail(int x) {
  for (; t[n - len[x] - 1] != t[n];) x = fail[x];
  return x;
}
inline void extend(int c) {
  t[++n] = c;
  int p = getfail(las);
  if (!ne[p][c]) {
    int u = ++cnt, q = getfail(fail[p]);
    len[u] = len[p] + 2;
    fail[u] = ne[q][c];
    ne[p][c] = u;
    d[u] = len[u] - len[fail[u]];
    anc[u] = (d[u] == d[fail[u]]) ? anc[fail[u]] : fail[u];
  }
  las = ne[p][c];
}
}  // namespace PAM
using PAM::anc;
using PAM::d;
using PAM::extend;
using PAM::fail;
using PAM::info;
using PAM::init;
using PAM::las;
using PAM::len;
long long f[1000010];
int n;
char t[1000010], s[1000010];
int main() {
  scanf("%s", t + 1);
  int n = strlen(t + 1);
  for (int i = 1; i <= (n >> 1); i++)
    s[(i << 1) - 1] = t[i], s[i << 1] = t[n - i + 1];
  init();
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    extend(s[i] - 'a');
    for (int j = las; len[j] > 0; j = anc[j]) {
      info[j] = f[i - len[anc[j]] - d[j]];
      if (anc[j] != fail[j]) Add(info[j], info[fail[j]]);
      if (!(i & 1)) Add(f[i], info[j]);
    }
  }
  printf("%lld\n", f[n]);
  return 0;
}