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;
template <typename Tp>
inline void read(Tp &x) {
  static char c;
  static bool neg;
  x = 0, c = getchar(), neg = false;
  for (; !isdigit(c); c = getchar()) {
    if (c == '-') {
      neg = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (neg) {
    x = -x;
  }
}
const int N = 1e6 + 5;
const int CS = 26;
const int MOD = 1e9 + 7;
namespace PAM {
int next[N][CS], length[N], fail[N], link[N], diff[N], jump[N], last = 0;
int nodeCnt = 0;
char str[N];
int len = 0;
inline int newNode(int len) {
  length[nodeCnt] = len;
  return nodeCnt++;
}
inline void init() {
  newNode(0);
  newNode(-1);
  fail[0] = 1;
  str[0] = '$';
}
inline int getFail(int x) {
  while (str[len - 1 - length[x]] != str[len]) {
    x = fail[x];
  }
  return x;
}
inline void extend() {
  ++len;
  int cur = getFail(last);
  int d = str[len] - 'a';
  if (!next[cur][d]) {
    int u = newNode(length[cur] + 2);
    fail[u] = next[getFail(fail[cur])][d];
    next[cur][d] = u;
    diff[u] = length[u] - length[fail[u]];
    if (diff[u] == diff[fail[u]]) {
      jump[u] = jump[fail[u]];
    } else {
      jump[u] = fail[u];
    }
  }
  last = next[cur][d];
}
}  // namespace PAM
inline void inc(int &x, const int &y) {
  x += y;
  if (x >= MOD) {
    x -= MOD;
  } else if (x < 0) {
    x += MOD;
  }
}
int n;
char str[N];
int f[N], ans[N];
int main() {
  PAM::init();
  scanf("%s", str);
  n = strlen(str);
  if (n % 2 == 1) {
    puts("0");
    return 0;
  }
  for (int i = 0; i < n; i += 2) {
    PAM::str[i + 1] = str[i / 2];
  }
  reverse(str, str + n);
  for (int i = 0; i < n; i += 2) {
    PAM::str[i + 2] = str[i / 2];
  }
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    PAM::extend();
    for (int u = PAM::last; u != 0; u = PAM::jump[u]) {
      f[u] = ans[i - PAM::length[PAM::jump[u]] - PAM::diff[u]];
      if (PAM::jump[u] != PAM::fail[u]) {
        inc(f[u], f[PAM::fail[u]]);
      }
      if (i % 2 == 0) {
        inc(ans[i], f[u]);
      }
    }
  }
  printf("%d\n", ans[n]);
}