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;
long long p1 = 1000000, p2 = 0;
char buf[1000005], wb[1000005];
long long gc() {
  if (p1 >= 1000000) fread(buf, 1, 1000000, stdin), p1 = 0;
  return buf[p1++];
}
long long getint() {
  long long ret = 0, flag = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    ret = (ret << 3) + (ret << 1) + c - '0';
    c = getchar();
  }
  return ret * flag;
}
void pc(char x) {
  if (p2 >= 1000000) fwrite(wb, 1, 1000000, stdout), p2 = 0;
  wb[p2++] = x;
}
void wrt(long long x) {
  if (x < 0) pc('-'), x = -x;
  long long c[24] = {0};
  if (!x) return pc('0'), void();
  while (x) c[++c[0]] = x % 10, x /= 10;
  while (c[0]) pc(c[c[0]--] + '0');
}
int n, g[1000005], f[1000005];
struct PAM {
  int tot, lst, len, s[1000005];
  struct node {
    int ch[26], fail, num, len, jp, dec;
  } v[1000005];
  int new_node(int x) {
    ++tot;
    for (int i = 0; i < 26; i++) v[tot].ch[i] = 0;
    v[tot].fail = v[tot].num = 0;
    v[tot].len = x;
    return tot;
  }
  void init() {
    tot = -1, s[len = 0] = -1, lst = 0;
    new_node(0), new_node(-1);
    v[0].fail = v[1].fail = 1;
  }
  int get_fail(int x) {
    while (s[len] != s[len - v[x].len - 1]) x = v[x].fail;
    return x;
  }
  int ins(int x, int id) {
    int now, p;
    s[++len] = x;
    p = get_fail(lst);
    if (!v[p].ch[x]) {
      now = new_node(v[p].len + 2);
      v[now].fail = v[get_fail(v[p].fail)].ch[x];
      v[now].num = v[v[now].fail].num + 1;
      v[p].ch[x] = now;
      v[now].dec = v[now].len - v[v[now].fail].len;
      v[now].jp =
          (v[now].dec == v[v[now].fail].dec) ? v[v[now].fail].jp : v[now].fail;
    }
    now = v[p].ch[x];
    return lst = v[p].ch[x];
  }
} P;
char lc[1000005], c[1000005];
void ask(int p, int now) {
  while (now) {
    g[now] = f[p - P.v[P.v[now].jp].len - P.v[now].dec];
    if (P.v[now].jp != P.v[now].fail)
      g[now] = (g[now] + g[P.v[now].fail]) % int(1e9 + 7);
    if (!(p & 1)) f[p] = (f[p] + g[now]) % int(1e9 + 7);
    now = P.v[now].jp;
  }
}
int main() {
  P.init();
  f[0] = 1, g[0] = 1;
  scanf("%s", lc + 1);
  n = strlen(lc + 1);
  for (int i = 1; i <= n >> 1; i++)
    c[(i << 1) - 1] = lc[i], c[(i << 1)] = lc[n - i + 1];
  for (int i = 1; i <= n; i++) ask(i, P.ins(c[i] - 97, i));
  wrt(f[n]), pc('\n');
  fwrite(wb, 1, p2, stdout);
  return 0;
}