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 int MAXN = 1e6 + 7;
int MOD = 1e9 + 7;
namespace PAM {
int scnt, S[MAXN];
int pcnt, last, len[MAXN], fail[MAXN], ch[MAXN][26];
int diff[MAXN], slink[MAXN];
int newnode(int _len) {
  len[pcnt] = _len;
  diff[pcnt] = slink[pcnt] = 0;
  for (int i = 0; i < 26; i++) ch[pcnt][i] = 0;
  return pcnt++;
}
inline void init() {
  S[scnt = 0] = -1;
  pcnt = 0;
  newnode(0);
  newnode(-1);
  fail[0] = 1;
  last = 0;
}
int getfail(int x) {
  while (S[scnt - len[x] - 1] != S[scnt]) x = fail[x];
  return x;
}
void extend(int c) {
  S[++scnt] = c;
  int cur = getfail(last);
  if (!ch[cur][c]) {
    int now = newnode(len[cur] + 2);
    fail[now] = ch[getfail(fail[cur])][c];
    ch[cur][c] = now;
    diff[now] = len[now] - len[fail[now]];
    slink[now] = (diff[now] == diff[fail[now]]) ? slink[fail[now]] : fail[now];
  }
  last = ch[cur][c];
}
};  // namespace PAM
using namespace PAM;
int g[MAXN], f[MAXN];
void sol(int i, int cur) {
  for (; cur; cur = slink[cur]) {
    g[cur] = f[i - len[slink[cur]] - diff[cur]];
    if (slink[cur] != fail[cur]) g[cur] = (g[cur] + g[fail[cur]]) % MOD;
    if (!(i & 1)) f[i] = (f[i] + g[cur]) % MOD;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int sn = s.size();
  init();
  f[0] = 1;
  for (int i = 0; i < sn; i += 2) {
    extend(s[i >> 1] - 'a');
    sol(i + 1, last);
    extend(s[sn - 1 - (i >> 1)] - 'a');
    sol(i + 2, last);
  }
  cout << f[sn] << endl;
  return 0;
}