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>
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += 1000000007;
}
inline void add(long long &a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
template <typename T>
inline T const &MAX(T const &a, T const &b) {
  return a > b ? a : b;
}
template <typename T>
inline T const &MIN(T const &a, T const &b) {
  return a < b ? a : b;
}
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007, b >>= 1;
  }
  return ans;
}
inline long long qp(long long a, long long b, long long c) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % c;
    a = a * a % c, b >>= 1;
  }
  return ans;
}
using namespace std;
const unsigned long long ba = 233;
const double eps = 1e-5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1000000 + 10, maxn = 1000000 + 10, inf = 0x3f3f3f3f;
struct PAM {
  int ch[N][26], fail[N], len[N], s[N], sf[N], dif[N];
  long long dp[N], ta[N];
  int last, n, p;
  int newnode(int w) {
    for (int i = 0; i < 26; i++) ch[p][i] = 0;
    len[p] = w;
    return p++;
  }
  void init() {
    dp[0] = 1;
    p = last = n = 0;
    newnode(0);
    newnode(-1);
    s[n] = -1;
    fail[0] = 1;
  }
  int getfail(int x) {
    while (s[n - len[x] - 1] != s[n]) x = fail[x];
    return x;
  }
  void ins(int c) {
    s[++n] = c;
    int cur = getfail(last);
    if (!ch[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = ch[getfail(fail[cur])][c];
      dif[now] = len[now] - len[fail[now]];
      sf[now] = dif[now] == dif[fail[now]] ? sf[fail[now]] : fail[now];
      ch[cur][c] = now;
    }
    last = ch[cur][c];
    for (int now = last; now; now = sf[now]) {
      ta[now] = dp[n - (len[sf[now]] + dif[now])];
      if (dif[now] == dif[fail[now]]) add(ta[now], ta[fail[now]]);
      if (n % 2 == 0) add(dp[n], ta[now]);
    }
  }
} pam;
char s[N];
int main() {
  pam.init();
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int i = 1; i <= n / 2; i++) {
    pam.ins(s[i] - 'a');
    pam.ins(s[n - i + 1] - 'a');
  }
  printf("%lld\n", pam.dp[n]);
  return 0;
}