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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int MAXN = 1000006, Mo = 1e9 + 7;
namespace PAM {
static const int H = 26;
int last, Slen, size;
int nt[MAXN][H], fl[MAXN], len[MAXN], S[MAXN];
int seriesLink[MAXN], f[MAXN], g[MAXN];
int newnode(int l) {
  for (int i = (0); i <= (H - 1); ++i) nt[size][i] = 0;
  len[size] = l;
  return size++;
}
inline int diff(int x) { return len[x] - len[fl[x]]; }
void init() {
  size = last = Slen = 0;
  newnode(0), newnode(-1);
  S[Slen] = -1, fl[0] = 1, fl[1] = 1;
  f[0] = 1, g[0] = g[1] = 0;
}
int getFail(int x) {
  while (S[Slen - len[x] - 1] != S[Slen]) x = fl[x];
  return x;
}
inline void update(int x[], int y, int z) {
  if (x[0] > y) x[0] = y, x[1] = z;
}
int getSum(int x) {
  int y = Slen - (len[seriesLink[x]] + diff(x));
  g[x] = f[y];
  if (diff(x) == diff(fl[x])) {
    g[x] += g[fl[x]];
    if (g[x] >= Mo) g[x] -= Mo;
  }
  return g[x];
}
void add(int c) {
  S[++Slen] = (c -= 'a');
  int cur = getFail(last);
  if (!nt[cur][c]) {
    int now = newnode(len[cur] + 2);
    fl[now] = nt[getFail(fl[cur])][c], nt[cur][c] = now;
    if (diff(now) == diff(fl[now]))
      seriesLink[now] = seriesLink[fl[now]];
    else
      seriesLink[now] = fl[now];
  }
  last = nt[cur][c];
  f[Slen] = 0;
  int tmp = 0;
  for (int now = last; len[now] > 0; now = seriesLink[now]) {
    int gS = getSum(now);
    if (!(Slen & 1)) {
      tmp += gS;
      if (tmp >= Mo) tmp -= Mo;
    }
  }
  f[Slen] = tmp;
}
void print() {
  for (int i = (1); i <= (Slen); ++i) putchar('a' + S[i]);
  puts("");
  for (int i = (1); i <= (Slen); ++i) printf("%d%c", f[i], " \n"[i == Slen]);
  for (int i = (0); i <= (size - 1); ++i) {
    printf("%d:fail[%d]=%d,len[%d]=%d\n", i, i, fl[i], i, len[i]);
    for (int j = (0); j <= (H - 1); ++j)
      if (nt[i][j]) printf("(%c%d)", 'a' + j, nt[i][j]);
    puts("");
  }
}
};  // namespace PAM
int n, m;
char s[MAXN];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  PAM::init();
  for (int i = (1); i <= (n / 2); ++i) PAM::add(s[i]), PAM::add(s[n + 1 - i]);
  printf("%d\n", PAM::f[n]);
  return 0;
}