#include <bits/stdc++.h>
using namespace std;

using ll=long long;
//#define int ll

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.a<<","<<p.b<<"}";
}

template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,-1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#ifdef LOCAL
void dmpr(ostream&os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
	os<<t<<" ";
	dmpr(os,args...);
}
#define dmp2(...) dmpr(cerr,__LINE__,##__VA_ARGS__)
#else
#define dmp2(...) void(0)
#endif

using uint=unsigned;
using ull=unsigned long long;

template<class t,size_t n>
ostream& operator<<(ostream&os,const array<t,n>&a){
	return os<<vc<t>(all(a));
}

template<int i,class T>
void print_tuple(ostream&,const T&){
}

template<int i,class T,class H,class ...Args>
void print_tuple(ostream&os,const T&t){
	if(i)os<<",";
	os<<get<i>(t);
	print_tuple<i+1,T,Args...>(os,t);
}

template<class ...Args>
ostream& operator<<(ostream&os,const tuple<Args...>&t){
	os<<"{";
	print_tuple<0,tuple<Args...>,Args...>(os,t);
	return os<<"}";
}

template<class t>
void print(t x,int suc=1){
	cout<<x;
	if(suc==1)
		cout<<"\n";
	if(suc==2)
		cout<<" ";
}

ll read(){
	ll i;
	cin>>i;
	return i;
}

vi readvi(int n,int off=0){
	vi v(n);
	rep(i,n)v[i]=read()+off;
	return v;
}

template<class T>
void print(const vector<T>&v,int suc=1){
	rep(i,v.size())
		print(v[i],i==int(v.size())-1?suc:2);
}

string readString(){
	string s;
	cin>>s;
	return s;
}

template<class T>
T sq(const T& t){
	return t*t;
}

//#define CAPITAL
void yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<"\n";
	#else
	cout<<"Yes"<<"\n";
	#endif
	if(ex)exit(0);
}
void no(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<"\n";
	#else
	cout<<"No"<<"\n";
	#endif
	if(ex)exit(0);
}
void possible(bool ex=true){
	#ifdef CAPITAL
	cout<<"POSSIBLE"<<"\n";
	#else
	cout<<"Possible"<<"\n";
	#endif
	if(ex)exit(0);
}
void impossible(bool ex=true){
	#ifdef CAPITAL
	cout<<"IMPOSSIBLE"<<"\n";
	#else
	cout<<"Impossible"<<"\n";
	#endif
	if(ex)exit(0);
}

constexpr ll ten(int n){
	return n==0?1:ten(n-1)*10;
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

int topbit(signed t){
	return t==0?-1:31-__builtin_clz(t);
}
int topbit(ll t){
	return t==0?-1:63-__builtin_clzll(t);
}
int botbit(signed a){
	return a==0?32:__builtin_ctz(a);
}
int botbit(ll a){
	return a==0?64:__builtin_ctzll(a);
}
int popcount(signed t){
	return __builtin_popcount(t);
}
int popcount(ll t){
	return __builtin_popcountll(t);
}
bool ispow2(int i){
	return i&&(i&-i)==i;
}
int mask(int i){
	return (int(1)<<i)-1;
}

bool inc(int a,int b,int c){
	return a<=b&&b<=c;
}

template<class t> void mkuni(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}

ll rand_int(ll l, ll r) { //[l, r]
	#ifdef LOCAL
	static mt19937_64 gen;
	#else
    static random_device rd;
    static mt19937_64 gen(rd());
    #endif
    return uniform_int_distribution<ll>(l, r)(gen);
}

template<class t>
int lwb(const vc<t>&v,const t&a){
	return lower_bound(all(v),a)-v.bg;
}

using uint=unsigned;
using ull=unsigned long long;

struct modinfo{uint mod,root;};
template<modinfo const&ref>
struct modular{
	static constexpr uint const &mod=ref.mod;
	static modular root(){return modular(ref.root);}
	uint v;
	//modular(initializer_list<uint>ls):v(*ls.bg){}
	modular(ll vv=0){s(vv%mod+mod);}
	modular& s(uint vv){
		v=vv<mod?vv:vv-mod;
		return *this;
	}
	modular operator-()const{return modular()-*this;}
	modular& operator+=(const modular&rhs){return s(v+rhs.v);}
	modular&operator-=(const modular&rhs){return s(v+mod-rhs.v);}
	modular&operator*=(const modular&rhs){
		v=ull(v)*rhs.v%mod;
		return *this;
	}
	modular&operator/=(const modular&rhs){return *this*=rhs.inv();}
	modular operator+(const modular&rhs)const{return modular(*this)+=rhs;}
	modular operator-(const modular&rhs)const{return modular(*this)-=rhs;}
	modular operator*(const modular&rhs)const{return modular(*this)*=rhs;}
	modular operator/(const modular&rhs)const{return modular(*this)/=rhs;}
	modular pow(int n)const{
		modular res(1),x(*this);
		while(n){
			if(n&1)res*=x;
			x*=x;
			n>>=1;
		}
		return res;
	}
	modular inv()const{return pow(mod-2);}
	/*modular inv()const{
		int x,y;
		int g=extgcd(v,mod,x,y);
		assert(g==1);
		if(x<0)x+=mod;
		return modular(x);
	}*/
	friend modular operator+(int x,const modular&y){
		return modular(x)+y;
	}
	friend modular operator-(int x,const modular&y){
		return modular(x)-y;
	}
	friend modular operator*(int x,const modular&y){
		return modular(x)*y;
	}
	friend modular operator/(int x,const modular&y){
		return modular(x)/y;
	}
	friend ostream& operator<<(ostream&os,const modular&m){
		return os<<m.v;
	}
	friend istream& operator>>(istream&is,modular&m){
		ll x;is>>x;
		m=modular(x);
		return is;
	}
	bool operator<(const modular&r)const{return v<r.v;}
	bool operator==(const modular&r)const{return v==r.v;}
	bool operator!=(const modular&r)const{return v!=r.v;}
	explicit operator bool()const{
		return v;
	}
};

//constexpr modinfo base{998244353,3};
constexpr modinfo base{1000000007,0};
using mint=modular<base>;

const int vmax=(1<<21)+10;
mint fact[vmax],finv[vmax],invs[vmax];
void initfact(){
	fact[0]=1;
	rng(i,1,vmax){
		fact[i]=fact[i-1]*i;
	}
	finv[vmax-1]=fact[vmax-1].inv();
	for(int i=vmax-2;i>=0;i--){
		finv[i]=finv[i+1]*(i+1);
	}
	for(int i=vmax-1;i>=1;i--){
		invs[i]=finv[i]*fact[i-1];
	}
}
mint choose(int n,int k){
	return fact[n]*finv[n-k]*finv[k];
}
mint binom(int a,int b){
	return fact[a+b]*finv[a]*finv[b];
}
mint catalan(int n){
	return binom(n,n)-(n-1>=0?binom(n-1,n+1):0);
}

//ABC135F
namespace rhash{
	const int k=2;
	vc<array<mint,k>> a,b;
	void init(int n){
		a.resize(n+1);
		b.resize(n+1);
		rep(i,k){
			a[0][i]=1;
			a[1][i]=rand_int(1,mint::mod-1);
			b[0][i]=1;
			b[1][i]=a[1][i].inv();
		}
		rng(i,1,n)
			rep(j,k){
				a[i+1][j]=a[i][j]*a[1][j];
				b[i+1][j]=b[i][j]*b[1][j];
			}
	}
	using P=pair<array<mint,k>,int>;
	P mrg(P x,P y){
		rep(i,k)
			x.a[i]+=y.a[i]*a[x.b][i];
		x.b+=y.b;
		return x;
	}
	struct gen{
		gen(){}
		vc<array<mint,k>> c;
		template<class S>
		gen(S s):c(s.size()+1){
			rep(i,s.size())
				rep(j,k)
					c[i+1][j]=c[i][j]+a[i][j]*s[i];
		}
		P get(int l,int r){
			P res;
			rep(i,k)
				res.a[i]=(c[r][i]-c[l][i])*b[l][i];
			res.b=r-l;
			return res;
		}
	};
}

struct N{
	int suf,l,r;
	int half;
	int len(){return r-l;}
	map<int,int> ch;
};

vi readinput(){
	string s;cin>>s;
	rhash::init(si(s));
	auto sh=rhash::gen(s);

	int n=si(s)/2;

	vc<rhash::P> ps;
	{
		int i=0;
		while(i<n){
			int j=i+1;
			while(j<=n){
				if(sh.get(i,j)==sh.get(n*2-j,n*2-i))break;
				j++;
			}
			if(j==n+1){
				print(0);
				exit(0);
			}
			ps.pb(sh.get(i,j));
			i=j;
		}
	}
	auto vs=ps;
	mkuni(vs);

	n=si(ps);
	vi z(n);
	rep(i,n)z[i]=lwb(vs,ps[i]);

	dmp(z);

	return z;
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);

	vi s=readinput();
	int n=si(s);

	vc<vc<pair<int,mint>>> buf(n+1);
	auto getval=[&](int i,int d){
		auto itr=lower_bound(all(buf[i]),mp(d,mint(0)));
		assert(itr!=buf[i].ed);
		assert(itr->a==d);
		return itr->b;
	};

	vc<mint> dp(n+1);
	dp[0]=1;

	vc<N> x;
	x.pb({-1,1,0,-1,{}});
	x.pb({0,0,0,-1,{}});

	auto chk=[&](int c,int i){
		x[c].l+=i-x[c].r;
		x[c].r=i;
		return x[c].l>0&&s[x[c].l-1]==s[i];
	};
	int c=1;
	rep(i,n){
		while(!chk(c,i))c=x[c].suf;
		if(x[c].ch.count(s[i])==0){
			int d=x[c].suf;
			if(d!=-1)while(!chk(d,i))d=x[d].suf;
			int e=d==-1?1:x[d].ch[s[i]];
			x[c].ch[s[i]]=x.size();
			x.pb({e,x[c].l-1,x[c].r+1,e,{}});
			if(x.back().len()<=x[e].len()*2)
				x.back().half=x[e].half;
		}
		c=x[c].ch[s[i]];

		int cur=c;
		while(cur>1){
			int len=x[cur].len();
			int dist=len-x[x[cur].suf].len();

			dmp2(i+1,len,dist);

			mint val;

			int p=len/dist;
			if(3<=p){
				int q=len%dist;
				val=getval(i+1-dist,i+1-len);
				val+=dp[i+1-q-dist];
			}else{
				rep(k,p)
					val+=dp[i+1-len+dist*k];
			}

			buf[i+1].eb(i+1-len,val);
			dp[i+1]+=val;
			cur=x[cur].half;
		}
		sort(all(buf[i+1]));
	}

	cout<<dp[n]<<endl;
}


// InterestingLSY
// codeforces&github: interestingLSY, qq: 2659723130
// 《幽灵公主》是真的好看！
#ifdef intLSY
#include <intlsy/stdc++.h>
#else
#include <bits/stdc++.h>
#endif
#include <bits/c++0x_warning.h>
using namespace std;
#define il inline
#define elif else if

// Type
#define ld double
#define ll long long
#define ull unsigned ll

// Vector
#define vc vector
#define Pb push_back
#define Pf push_front
#define Eb emplace_back
#define All(x) x.begin(),x.end()
#define AllRev(x) x.rbegin(),x.rend()

// Memory
#define Ms(_data) memset(_data,0,sizeof(_data))
#define Msn(_data,_num) memset(_data,_num,sizeof(_data))

// Pair
#define F first
#define S second
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>

// Loop
#define For(i,j) for( int (i) = 1 ; (i) <= (j) ; ++(i) )
#define For0(i,j) for( int (i) = 0 ; (i) < (j) ; ++(i) )
#define Forx(i,j,k) for( int (i) = (j) ; (i) <= (k) ; ++(i) )
#define Forstep(i,j,k,st) for( int (i) = (j) ; (i) <= (k) ; (i) += (st) )
#define fOR(i,j) for( int (i) = (j) ; (i) >= 1 ; --(i) )
#define fOR0(i,j) for( int (i) = (j)-1 ; (i) >= 0 ; --(i) )
#define fORx(i,j,k) for( int (i) = (k) ; (i) >= (j) ; --(i) )

// Read
struct InputReader{
	static constexpr int MAXSZ = 1048576;
	char buf[MAXSZ]; int p, ed;
	bool detectedEOF = false;
	il InputReader(){ p = MAXSZ; }
	il void Flush(){ p = 0; ed = fread(buf,1,MAXSZ,stdin); }
	il void GetChar( char &c ){
		if(p >= MAXSZ) Flush();
		if( p == ed ){ detectedEOF = true; }
		c = buf[p++];
	}
	il void ReadNum( char &c ){ GetChar(c); while( !isdigit(c) && c != '-' && !detectedEOF ) GetChar(c); }
	il void ReadAlpha( char &c ){ GetChar(c); while( !isalpha(c) && !detectedEOF ) GetChar(c); }
	il void ReadInt( int &ans ){
		ans = 0; int nega = 1;
		char c; ReadNum(c); if(detectedEOF) return;
		if( c == '-' ){
			nega = -1;
			GetChar(c);
		}
		while( isdigit(c) && !detectedEOF ){
			ans = ans*10 + c-'0';
			GetChar(c);
		}
		ans *= nega;
	}
	il void Readll( ll &ans ){
		ans = 0; int nega = 1;
		char c; ReadNum(c); if(detectedEOF) return;
		if( c == '-' ){
			nega = -1;
			GetChar(c);
		}
		while( isdigit(c) && !detectedEOF ){
			ans = ans*10 + c-'0';
			GetChar(c);
		}
		ans *= nega;
	}
	il void ReadString( string &x ){
		x.clear(); char ch; GetChar(ch);
		while( !isdigit(ch) && !isalpha(ch) && ch != '#' && ch != '.' && !detectedEOF ) GetChar(ch); if(detectedEOF) return;
		while( (isdigit(ch) || isalpha(ch) || ch == '#' || ch == '.') && !detectedEOF ){
			x += ch;
			GetChar(ch);
		}
	}
	il void ReadCString( char s[] ){
		int len = 0; char ch; GetChar(ch);
		while( !isdigit(ch) && !isalpha(ch) && ch != '#' && ch != '.' && !detectedEOF ) GetChar(ch); if(detectedEOF) return;
		while( (isdigit(ch) || isalpha(ch) || ch == '#' || ch == '.') && !detectedEOF ){
			s[len++] = ch;
			GetChar(ch);
		}
		s[len] = '\0';
	}
	il void SpecialRead( char &c ){
		GetChar(c); if(detectedEOF) return;
		while( !isdigit(c) && !isalpha(c) && c != '#' && c != '.' && c != '=' && c != 'B' && !detectedEOF ) GetChar(c);
	}
}In;
il void Read( int &x ){ In.ReadInt(x); }
il void Read( int &x, int &y ){ In.ReadInt(x); In.ReadInt(y); }
il void Read( int &x1 , int &x2 , int &x3 ){ In.ReadInt(x1); In.ReadInt(x2); In.ReadInt(x3); }
il void Read( int &x1 , int &x2 , int &x3 , int &x4 ){ In.ReadInt(x1); In.ReadInt(x2); In.ReadInt(x3); In.ReadInt(x4); }
il void Read( ll &x ){ In.Readll(x); }
il void Read( ll &x, ll &y ){ In.Readll(x); In.Readll(y); }
il void Read( ll &x1 , ll &x2 , ll &x3 ){ In.Readll(x1); In.Readll(x2); In.Readll(x3); }
il void Read( ll &x1 , ll &x2 , ll &x3 , ll &x4 ){ In.Readll(x1); In.Readll(x2); In.Readll(x3); In.Readll(x4); }
template<typename T> void Read( T a[] , int st , int ed ){ Forx(i,st,ed) Read(a[i]); }
#define iRead(k) int k; Read(k);
#define iRead2(a,b) iRead(a); iRead(b);
#define iRead3(a,b,c) iRead2(a,b); iRead(c);
#define iRead4(a,b,c,d) iRead2(a,b); iRead2(c,d);
#define lRead(k) ll k; Read(k);
#define lRead2(a,b) lRead(a); lRead(b);
#define lRead3(a,b,c) lRead2(a,b); lRead(c);
#define lRead4(a,b,c,d) lRead2(a,b); lRead2(c,d);

// File
#define Fin(a) freopen(a,"r",stdin)
#define Fout(a) freopen(a,"w",stdout)
il void FILEIO(){
	#ifdef intLSY
		Fin("in.in");
	#endif
}
il void FILEIO( string pname ){
	#ifndef intLSY
		Fin((pname+".in").c_str());
		Fout((pname+".out").c_str());
	#else
		Fin("in.in");
	#endif
}
il void FILEIO_OICONTEST( string pname ){
	Fin((pname+".in").c_str());
	#ifndef intLSY
		Fout((pname+".out").c_str());
	#endif
}
void Printtime(){
	#ifdef intLSY
		double _timeuse = clock()* 1000.0 / CLOCKS_PER_SEC;
		fprintf(stderr,"\n\nTime usage:\n%.0lf ms\n",_timeuse);
	#endif
}
void END(){ Printtime(); exit(0); }
template<typename T>void END( T mes ){ cout << mes << endl; END(); }

// Debug
#define B cerr << "BreakPoint" << endl;
#define O(x) cerr << #x << " " << (x) << endl;
#define o(x) cerr << #x << " " << (x) << "  ";
template<typename T0>
void P( T0 t0 ){
	cerr << t0 << endl;
}
template<typename T0, typename... Ts>
void P( T0 t0 , Ts... ts ){
	cerr << t0 << " ";
	P(ts...);
}
#define Msz(x) cerr << "Sizeof " << #x << " " << sizeof(x)/1024/1024 << " MB" << endl;
template<typename T>void Print( T a[] , int s , int t , char sp = ' ' , char ed = '\n' ){
	if( s > t ) return;
	for( int i = s ; i < t ; i++ )
		cout << a[i] << sp;
	cout << a[t] << ed;
	cout.flush();
}
template<typename T>void Print( T a , int s = 0 , int t = -1 , char sp = ' ' , char ed = '\n' ){
	if( t == -1 ) t = a.size()-1;
	for( int i = s ; i <= t ; i++ )
		cout << a[i] << sp;
	cout << ed;
	cout.flush();
}

// Optimize
#define Max(a,b) ((a)>(b)?(a):(b))
#define Min(a,b) ((a)<(b)?(a):(b))
#define Mymax(a,b) (a) = max((a),(b))
#define Mymin(a,b) (a) = min((a),(b))
#define MyMax(a,b) (a) = Max((a),(b))
#define MyMin(a,b) (a) = Min((a),(b))
#define INF (0x3f3f3f3f)
#define LINF ((long long)(0x3f3f3f3f3f3f3f3f))
#define Sqr(x) ((x)*(x))
#define Lowbit(a) ((a)&(-(a)))
constexpr int MOD = 1'000'000'007;
#define Rmoi(a,b) (((a)%b+b)%b)
#define Rmo(a) (((a)%MOD+MOD)%MOD)
#define Rmod(a) a = ((a%MOD+MOD)%MOD)
#define Rmodi(a,b) a = ((a%(b)+(b))%(b))
#define Mymoi(a,b) ((a)>=b?((a)-b):(a))
#define Mymodi(a,b) a = ((a)>=(b))?((a)-(b)):(a)
template<typename T>
il T Mymo( const T &x ){ return x >= MOD ? x-MOD : x; }
template<typename T>
il void Mymod( T &x ){ x = x >= MOD ? x-MOD : x; }
template<typename T1, typename T2>
il void Addi( T1 &x , const T2 &y ){ x = Mymo(x+y); }
template<typename T1, typename T2>
il void Deci( T1 &x , const T2 &y ){ x = Mymo(x-y+MOD); }
template<typename T1, typename T2>
il void Muli( T1 &x , const T2 &y ){ x = 1LL*x*y%MOD; }
il ll Pow( ll a , ll b , const ll p = MOD ){
	ll ret = 1;
	for( ; b ; a = a*a%p, b >>= 1 )
		if(b&1) ret = ret*a%p;
	return ret;
}
il ll Inv( ll a , const ll p = MOD ){ return Pow(a,p-2LL,p); }
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
constexpr int MAXN = 1048576;

int n;
string s;

struct PAM{
	struct Node{
		int to[26];
		int fa;
		int len;
		int nextArith;
		int arithDiff;
		int arithSum;
	};
	#define To(pos,c) t[pos].to[c]
	#define Fa(pos) t[pos].fa
	#define Len(pos) t[pos].len
	#define NextArith(pos) t[pos].nextArith
	#define ArithDiff(pos) t[pos].arithDiff
	#define ArithSum(pos) t[pos].arithSum
	Node t[MAXN];
	int nowNode = 0;
	int lastNode = 1;

	void Init(){
		Len(1) = -1;
		Len(2) = 0;
		Fa(2) = 1;
		nowNode = 2;
	}

	void AppendChar( int i ){
		const char c = s[i];
		int p = lastNode;
		while( s[i-Len(p)-1] != c ) p = Fa(p);
		if(!To(p,c)){
			To(p,c) = ++nowNode;
			Len(To(p,c)) = Len(p) + 2;
		}
		int cur = To(p,c);
		lastNode = cur;

		if( p == 1 ) Fa(cur) = 2;
		else{
			p = Fa(p);
			while( s[i-Len(p)-1] != c ) p = Fa(p);
			assert(To(p,c));
			Fa(cur) = To(p,c);
		}

		ArithDiff(cur) = Len(cur) - Len(Fa(cur));
		if( ArithDiff(cur) == ArithDiff(Fa(cur)) )
			NextArith(cur) = NextArith(Fa(cur));
		else
			NextArith(cur) = Fa(cur);
	}

	ll Solve(){
		static ll dp[MAXN];
		dp[0] = 1;
		For(i,n){
			AppendChar(i);
			static vc<int> tmp; tmp.clear();
			for( int p = lastNode ; Len(p) > 0 ; p = NextArith(p) )
				tmp.Eb(p);
			for_each(AllRev(tmp),[&]( int p ){
				ArithSum(p) = dp[i-Len(NextArith(p))-ArithDiff(p)];
				if( ArithDiff(Fa(p)) == ArithDiff(p) ){
					// O(p);
					Addi( ArithSum(p) , ArithSum(Fa(p)) );
				}
				if(i&1^1) Addi(dp[i],ArithSum(p));
			});
		}
		return dp[n];
	}
};
PAM pam;

void Readin(){
	static string t;
	In.ReadString(t);
	n = t.length();
	s = " ";
	int lp = 0, rp = n-1;
	For(i,n){
		if(i&1){ s += t[lp]; ++lp; }
		else{ s += t[rp]; --rp; }
	}
	// O(s);
	for( auto &c : s ) if( c != ' ' ) c -= 'a';
}

int main(){
	FILEIO();

	Readin();

	pam.Init();
	ll ans = pam.Solve();
	cout << ans << endl;

	END();
}


#include <bits/stdc++.h>
#define watch(x) std::cout << "$ LINE @" << __LINE__ << " FUNC @" << __FUNCTION__ << "\n$ " \
                           << (#x) << ": " << x << std::endl

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

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]);
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define sz(a) ((int)a.size())
#define pb push_back
#define lson (rt << 1)
#define rson (rt << 1 | 1)
#define gmid (l + r >> 1)
const int maxn = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;

char s[maxn], t[maxn];
int nxt[maxn][26], fail[maxn], len[maxn], st[maxn], dt[maxn];
int f[maxn], g[maxn];
int n, cnt, cur, last;

int add(int l){

	++cnt; len[cnt] = l; return cnt;
}

void init(){

	cnt = -1; add(0), add(-1);
	s[0] = '@', cur = last = fail[0] = 1;
}

int getf(int x){

	while(s[cur] != s[cur - len[x] - 1]) x = fail[x];
	return x;
}

void insert(char ch){

	s[cur] = ch;
	int t = ch - 'a', p = getf(last);
	if(!nxt[p][t]){

		int q = add(len[p] + 2);
		fail[q] = nxt[getf(fail[p])][t];
		dt[q] = len[q] - len[fail[q]];
		st[q] = dt[q] == dt[fail[q]] ? st[fail[q]] : fail[q];
		nxt[p][t] = q;
	}
	last = nxt[p][t], ++cur;
}

void solve(){

	init(); f[0] = 1;
	for(int i = 1; i <= n; ++i){

		insert(s[i]); f[i] = 0;
		for(int j = last; j; j = st[j]){

			g[j] = f[i - len[st[j]] - dt[j]];
			if(st[j] != fail[j]) (g[j] += g[fail[j]]) %= mod;
			if(~i & 1) (f[i] += g[j]) %= mod;
		}
	}
	cout << f[n] << endl;
}

int main(){

	ios::sync_with_stdio(0); cin.tie(0);
	cin >> t + 1;
	n = strlen(t + 1);
	for(int i = 1; i <= n; i += 2){

		s[i] = t[i / 2 + 1];
	}
	reverse(t + 1, t + 1 + n);
	for(int i = 1; i <= n; i += 2){

		s[i + 1] = t[i / 2 + 1];
	}
	// cout << s + 1 << endl;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int maxn = 1000000 + 5;
inline int add(int x, int y) {
  x += y;
  return x >= mod ? x -= mod : x;
}
namespace pam {
int sz, tot, last;
int ch[maxn][26], len[maxn], fail[maxn];
int cnt[maxn], dep[maxn], dif[maxn], slink[maxn];
char s[maxn];
int node(int l) {
  sz++;
  memset(ch[sz], 0, sizeof(ch[sz]));
  len[sz] = l;
  fail[sz] = 0;
  cnt[sz] = 0;
  dep[sz] = 0;
  return sz;
}
void clear() {
  sz = -1;
  last = 0;
  s[tot = 0] = '$';
  node(0);
  node(-1);
  fail[0] = 1;
}
int getfail(int x) {
  while (s[tot - len[x] - 1] != s[tot]) x = fail[x];
  return x;
}
void insert(char c) {
  s[++tot] = c;
  int now = getfail(last);
  if (!ch[now][c - 'a']) {
    int x = node(len[now] + 2);
    fail[x] = ch[getfail(fail[now])][c - 'a'];
    dep[x] = dep[fail[x]] + 1;
    ch[now][c - 'a'] = x;
    dif[x] = len[x] - len[fail[x]];
    if (dif[x] == dif[fail[x]])
      slink[x] = slink[fail[x]];
    else
      slink[x] = fail[x];
  }
  last = ch[now][c - 'a'];
  cnt[last]++;
}
}  // namespace pam
using pam::dif;
using pam::fail;
using pam::len;
using pam::slink;
int n, dp[maxn], g[maxn];
char s[maxn], t[maxn];
int main() {
  pam::clear();
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1, j = 0; i <= n; i++) t[++j] = s[i], t[++j] = s[n - i + 1];
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    pam::insert(t[i]);
    for (int x = pam::last; x > 1; x = slink[x]) {
      g[x] = dp[i - len[slink[x]] - dif[x]];
      if (dif[x] == dif[fail[x]]) g[x] = add(g[x], g[fail[x]]);
      if (i % 2 == 0) dp[i] = add(dp[i], g[x]);
    }
  }
  printf("%d", dp[n]);
  return 0;
}


#include <cstdio>
#include <algorithm>
#include <iostream>
#include <queue>
#include <bitset>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <unordered_map>
using namespace std;
const int M = 1e6 + 100;
int f[M];
const int mod = 1e9 + 7;
namespace border_pam {//pam borderdp一般维护最大border及其等差数列的border的信息（最短的那个不维护）进行加速（log段）,利用好diff和anc pam的border等价于子后缀
    struct node {
        int son[26];
        int fail, len;
        int diff,  anc;//border公差，相同border公差的最高fail祖先，最多log段
        int g;//用于维护log段的信息和，进行加速，对于长度为x的回文串，有border长度为len，公差为d，则对于其长度为x-d的前缀，拥有长度为len-dborder，所以dp转移时可以按顺序挂在树上做，具体看update
        void clear() {
            for (int i = 0; i < 26; i++)
                son[i] = 0;
            fail = len = 0;
            diff = anc = 0;
        }
    } tri[M];

    char S[M];
    int lst, L, N, len;

    void pre() {
        S[0] = -1;
        tri[1].clear();
        tri[0].clear();
        tri[1].len = -1;
        tri[0].fail = 1;
        lst = 0;
        L = 1;
    }

    int getfail(int x) {
        while (S[N] != S[N - tri[x].len - 1])x = tri[x].fail;
        return x;
    }

    void add() {
        static int y;
        y = getfail(lst);
        if (!tri[y].son[S[N] - 'a']) {
            tri[++L].clear();
            tri[L].fail = tri[getfail(tri[y].fail)].son[S[N] - 'a'], tri[L].len = tri[y].len + 2;
            tri[y].son[S[N] - 'a'] = L;
            tri[L].diff = tri[L].len - tri[tri[L].fail].len;
            tri[L].anc = (tri[tri[L].fail].diff == tri[L].diff)?tri[tri[L].fail].anc:tri[L].fail;
        }
        lst = tri[y].son[S[N] - 'a'];
    }
    void update(int x){
        for (int i = lst; i > 1; i = tri[i].anc) {
            tri[i].g = f[x - tri[tri[i].anc].len - tri[i].diff];
            if (tri[i].anc != tri[i].fail)
                (tri[i].g += tri[tri[i].fail].g ) %= mod;
            (f[x] += ((x & 1) == 0) * tri[i].g ) %= mod;
        }
    }
}
int n;
char t[M];
int main() {
    scanf("%s", t + 1);
    n = strlen(t + 1);
    int x = 0;
    for (int i = 1; i <= n / 2; i ++) {
        border_pam::S[++x] = t[i];
        border_pam::S[++x] = t[n - i + 1];
    }
    border_pam::pre();
    f[0] = 1;
    for (border_pam::N = 1; border_pam::N <= n;border_pam:: N ++){
        border_pam::add();
        border_pam::update(border_pam::N);
    }
    printf("%d\n", f[n]);
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <iostream>
#include <queue>
#include <bitset>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <unordered_map>
using namespace std;
const int M = 1e6;
int f[M];
const int mod = 1e9 + 7;
namespace border_pam {//pam borderdp一般维护最大border及其等差数列的border的信息（最短的那个不维护）进行加速（log段）,利用好diff和anc pam的border等价于子后缀
    struct node {
        int son[26];
        int fail, len;
        int diff,  anc;//border公差，相同border公差的最高fail祖先，最多log段
        int g;//用于维护log段的信息和，进行加速，对于长度为x的回文串，有border长度为len，公差为d，则对于其长度为x-d的前缀，拥有长度为len-dborder，所以dp转移时可以按顺序挂在树上做，具体看update
        void clear() {
            for (int i = 0; i < 26; i++)
                son[i] = 0;
            fail = len = 0;
            diff = anc = 0;
        }
    } tri[M];

    char S[M];
    int lst, L, N, len;

    void pre() {
        S[0] = -1;
        tri[1].clear();
        tri[0].clear();
        tri[1].len = -1;
        tri[0].fail = 1;
        lst = 0;
        L = 1;
    }

    int getfail(int x) {
        while (S[N] != S[N - tri[x].len - 1])x = tri[x].fail;
        return x;
    }

    void add() {
        static int y;
        y = getfail(lst);
        if (!tri[y].son[S[N] - 'a']) {
            tri[++L].clear();
            tri[L].fail = tri[getfail(tri[y].fail)].son[S[N] - 'a'], tri[L].len = tri[y].len + 2;
            tri[y].son[S[N] - 'a'] = L;
            tri[L].diff = tri[L].len - tri[tri[L].fail].len;
            tri[L].anc = (tri[tri[L].fail].diff == tri[L].diff)?tri[tri[L].fail].anc:tri[L].fail;
        }
        lst = tri[y].son[S[N] - 'a'];
    }
    void update(int x){
        for (int i = lst; i > 1; i = tri[i].anc) {
            tri[i].g = f[x - tri[tri[i].anc].len - tri[i].diff];
            if (tri[i].anc != tri[i].fail)
                (tri[i].g += tri[tri[i].fail].g ) %= mod;
            (f[x] += ((x & 1) == 0) * tri[i].g ) %= mod;
        }
    }
}
int n;
char t[M];
int main() {
    scanf("%s", t + 1);
    n = strlen(t + 1);
    int x = 0;
    for (int i = 1; i <= n / 2; i ++) {
        border_pam::S[++x] = t[i];
        border_pam::S[++x] = t[n - i + 1];
    }
    border_pam::pre();
    f[0] = 1;
    for (border_pam::N = 1; border_pam::N <= n;border_pam:: N ++){
        border_pam::add();
        border_pam::update(border_pam::N);
    }
    printf("%d\n", f[n]);
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <iostream>
#include <queue>
#include <bitset>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <unordered_map>
using namespace std;
const int M = 4e6;
int f[M];
const int mod = 1e9 + 7;
namespace border_pam {//pam borderdp一般维护最大border及其等差数列的border的信息（最短的那个不维护）进行加速（log段）,利用好diff和anc pam的border等价于子后缀
    struct node {
        int son[26];
        int fail, len;
        int diff,  anc;//border公差，相同border公差的最高fail祖先，最多log段
        int g;//用于维护log段的信息和，进行加速，对于长度为x的回文串，有border长度为len，公差为d，则对于其长度为x-d的前缀，拥有长度为len-dborder，所以dp转移时可以按顺序挂在树上做，具体看update
        void clear() {
            for (int i = 0; i < 26; i++)
                son[i] = 0;
            fail = len = 0;
            diff = anc = 0;
        }
    } tri[M];

    char S[M];
    int lst, L, N, len;

    void pre() {
        S[0] = -1;
        tri[1].clear();
        tri[0].clear();
        tri[1].len = -1;
        tri[0].fail = 1;
        lst = 0;
        L = 1;
    }

    int getfail(int x) {
        while (S[N] != S[N - tri[x].len - 1])x = tri[x].fail;
        return x;
    }

    void add() {
        static int y;
        y = getfail(lst);
        if (!tri[y].son[S[N] - 'a']) {
            tri[++L].clear();
            tri[L].fail = tri[getfail(tri[y].fail)].son[S[N] - 'a'], tri[L].len = tri[y].len + 2;
            tri[y].son[S[N] - 'a'] = L;
            tri[L].diff = tri[L].len - tri[tri[L].fail].len;
            tri[L].anc = (tri[tri[L].fail].diff == tri[L].diff)?tri[tri[L].fail].anc:tri[L].fail;
        }
        lst = tri[y].son[S[N] - 'a'];
    }
    void update(int x){
        for (int i = lst; i > 1; i = tri[i].anc) {
            tri[i].g = f[x - tri[tri[i].anc].len - tri[i].diff];
            if (tri[i].anc != tri[i].fail)
                (tri[i].g += tri[tri[i].fail].g ) %= mod;
            (f[x] += ((x & 1) == 0) * tri[i].g ) %= mod;
        }
    }
}
int n;
char t[M];
int main() {
    scanf("%s", t + 1);
    n = strlen(t + 1);
    int x = 0;
    for (int i = 1; i <= n / 2; i ++) {
        border_pam::S[++x] = t[i];
        border_pam::S[++x] = t[n - i + 1];
    }
    border_pam::pre();
    f[0] = 1;
    for (border_pam::N = 1; border_pam::N <= n;border_pam:: N ++){
        border_pam::add();
        border_pam::update(border_pam::N);
    }
    printf("%d\n", f[n]);
    return 0;
}


# include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int maxn(1e6 + 5);
const int mod(1e9 + 7);

inline void Inc(int &x, int y) {
	if ((x += y) >= mod) x -= mod;
}

int n, f[maxn], diff[maxn], anc[maxn], g[maxn];
int fa[maxn], len[maxn], trans[26][maxn], tot, last;
char s[maxn], tmp[maxn];

inline void Extend(int c, int pos) {
	register int np, p = last, q, i;
	while (s[pos] != s[pos - len[p] - 1]) p = fa[p];
	if (!trans[c][p]) {
		np = ++tot, len[np] = len[p] + 2, q = fa[p];
		while (s[pos] != s[pos - len[q] - 1]) q = fa[q];
		fa[np] = trans[c][q], trans[c][p] = np;
		diff[np] = len[np] - len[fa[np]];
		anc[np] = diff[np] == diff[fa[np]] ? anc[fa[np]] : fa[np];
	}
	last = trans[c][p];
}

int main() {
	register int i, j, l = 0;
	scanf(" %s", tmp + 1), n = strlen(tmp + 1);
	if (n & 1) return puts("0"), 0;
	for (i = 1, j = n; i <= j; ++i, --j) s[++l] = tmp[i], s[++l] = tmp[j];
	f[0] = 1, len[1] = -1, fa[1] = fa[0] = 1, tot = last = 1;
	for (i = 1; i <= n; ++i) {
		Extend(s[i] - 'a', i);
		for (j = last; j; j = anc[j]) {
			g[j] = f[i - len[anc[j]] - diff[j]];
            if(anc[j] != fa[j]) Inc(g[j], g[fa[j]]);
			if (~i & 1) Inc(f[i], g[j]);
		}
	}
	printf("%d\n", f[n]);
	return 0;
}


//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const ll mod=1000*1000*1000+7;

const int maxn=1000*1000+7, alfa=26;
int len[maxn], link[maxn], to[maxn][alfa], slink[maxn], diff[maxn];
int sz, last, n;
char s[maxn];

void init() {
	s[n++]=len[1]=-1;
	link[0]=1;
	sz=2;
}
int get_link(int v) {
	while(s[n-len[v]-2]!=s[n-1]) v=link[v];
	return v;
}
void add_letter(char c) {
	s[n++]=c-='a';
	last=get_link(last);
	if(!to[last][c]) {
		len[sz]=len[last]+2;
		link[sz]=to[get_link(link[last])][c];
		diff[sz]=len[sz]-len[link[sz]];
		slink[sz]=(diff[sz]==diff[link[sz]] ? slink[link[sz]] : link[sz]);
		to[last][c]=sz++;
	}
	last=to[last][c];
}

const int nax=1e6+7;
int m;
char wcz[nax];
char tekst[nax];

ll dp[nax];
ll serdp[nax];

void dod(ll &a, ll b)
{
	a=(a+b)%mod;
}

int main() {
	scanf("%s", wcz+1);
	m=strlen(wcz+1);
	for (int i=1; i<=m/2; i++)
	{
		tekst[2*i-1]=wcz[i];
		tekst[2*i]=wcz[m+1-i];
	}
	init();
	dp[0]=1;
	for(int i=1; i<=m; i++) {
		add_letter(tekst[i]);
		for(int v=last; len[v]>0; v=slink[v]) {
			serdp[v]=dp[i-(len[slink[v]]+diff[v])];
			if(diff[v] == diff[link[v]])
				dod(serdp[v], serdp[link[v]]);
			if (!(i&1)) {
				dod(dp[i], serdp[v]);
			}
		}
	}
	printf("%lld\n", dp[m]);
}


#include<bits/stdc++.h>
#define fo(i, x, y) for(int i = x, _b = y; i <= _b; i ++)
#define ff(i, x, y) for(int i = x, _b = y; i <  _b; i ++)
#define fd(i, x, y) for(int i = x, _b = y; i >= _b; i --)
#define ll long long
#define pp printf
#define hh pp("\n")
using namespace std;

const int N = 1e6 + 5;

char s[N], t[N];
int n;

void Init() {
	scanf("%s", t + 1);
	n = strlen(t + 1);
	int l = 1, r = n;
	int s0 = 0;
	while(l <= r) {
		s[++ s0] = t[l ++];
		if(l <= r) s[++ s0] = t[r --];
	}
}

const int mo = 1e9 + 7;

ll f[N];

struct hwt {
	int n;
	int son[N][26], fa[N], len[N], tot, la;

	int dta[N], to[N];

	ll g[N];

	void build() {
		s[0] = -1;
		tot = 1;
		len[1] = -1;
		len[0] = 0;
		fa[0] = 1;
		la = 0;
		g[0] = 1;
	}

	int gf(int x) {
		while(s[n - len[x] - 1] != s[n]) x = fa[x];
		return x;
	}

	void add(int c) {
		n ++;
		int p = gf(la);
		if(!son[p][c]) {
			len[++ tot] = len[p] + 2;
			fa[tot] = son[gf(fa[p])][c];
			son[p][c] = tot;

			int q = tot;
			dta[q] = len[q] - len[fa[q]];
			if(dta[q] == dta[fa[q]]) to[q] = to[fa[q]]; else
				to[q] = fa[q];
		}
		p = son[p][c];
		la = p;

		for(int x = la; x > 1; x = fa[to[x]]) {
			if(fa[x] == 0) {
				g[x] = f[n - len[x]] ;
			} else {
				g[x] = (g[fa[x]] + f[n - len[to[x]]]) % mo;
			}
		}
	}

	ll calc() {
		ll ans = 0;
		for(int x = la; x > 1; x = fa[to[x]]) {
			ans = (ans + g[x]) % mo;
		}
		return ans;
	}

} suf;

int main() {
	Init();
	suf.build();
	f[0] = 1;
	fo(i, 1, n) {
		suf.add(s[i] - 'a');
		f[i] = suf.calc();
		if(i & 1) f[i] = 0;
	}
	pp("%lld\n", f[n]);
}


#include<bits/stdc++.h>
#define fo(i, x, y) for(int i = x, _b = y; i <= _b; i ++)
#define ff(i, x, y) for(int i = x, _b = y; i <  _b; i ++)
#define fd(i, x, y) for(int i = x, _b = y; i >= _b; i --)
#define ll long long
#define pp printf
#define hh pp("\n")
using namespace std;

const int N = 1e6 + 5;

char s[N], t[N];
int n;

void Init() {
	scanf("%s", t + 1);
	n = strlen(t + 1);
	int l = 1, r = n;
	int s0 = 0;
	while(l <= r) {
		s[++ s0] = t[l ++];
		if(l <= r) s[++ s0] = t[r --];
	}
}

const int mo = 1e9 + 7;

ll f[N];

struct hwt {
	int n;
	int son[N][26], fa[N], len[N], tot, la;

	int dta[N], to[N];

	ll g[N];

	void build() {
		tot = 1; la = 0;
		fa[0] = fa[1] = 1;
		len[0] = 0; len[1] = -1;
		s[0] = -1;
	}

	int gf(int x) {
		while(s[n - len[x] - 1] != s[n]) x = fa[x];
		return x;
	}

	void add(int c) {
		n ++;
		int p = gf(la);
		if(!son[p][c]) {
			int q = ++ tot;
			len[q] = len[p] + 2;
			fa[q] = son[gf(fa[p])][c];
			son[p][c] = q;
			dta[q] = len[q] - len[fa[q]];
			to[q] = (dta[q] == dta[fa[q]] ? to[fa[q]] : fa[q]);
		}
		p = son[p][c];
		la = p;

		for(int x = la; x; x = to[x]) {
			g[x] = f[n - len[to[x]] - dta[x]];
			if(to[x] != fa[x]) g[x] = (g[x] + g[fa[x]]) % mo;
		}
	}

	ll calc() {
		ll ans = 0;
		for(int x = la; x; x = to[x]) {
			ans = (ans + g[x]) % mo;
		}
		return ans;
	}

} suf;

int main() {
	Init();
//	fo(i, 1, n) pp("%c", s[i]); hh;
	suf.build();
	f[0] = 1;
	fo(i, 1, n) {
		suf.add(s[i] - 'a');
		f[i] = suf.calc();
		if(i & 1) f[i] = 0;
	}
	pp("%lld\n", f[n]);
}


#include <bits/stdc++.h>

using namespace std;
const int mod=1000000007;

#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define Debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long LL;
typedef long double LD;
typedef unsigned int uint;
typedef pair <int, int> pii;
typedef unsigned long long uLL;

template <typename T> inline void Read(T &x) {
  char c = getchar();
  bool f = false;
  for (x = 0; !isdigit(c); c = getchar()) {
    if (c == '-') {
      f = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (f) {
    x = -x;
  }
}

const int N = 1000010;

int n, lst, cnt, f[N], g[N], h[N], anc[N], par[N], dif[N], len[N], nxt[N][26];
char s[N], p[N], q[N];

inline void Extend(int w, int n) {
  int p;
  for (p = lst; s[n] != s[n - len[p] - 1]; p = par[p]);
  if (!nxt[p][w]) {
    int x = ++cnt, k = par[p];
    for (; s[n] != s[n - len[k] - 1]; k = par[k]);
    len[x] = len[p] + 2, par[x] = nxt[k][w], nxt[p][w] = x, dif[x] = len[x] - len[par[x]], anc[x] = dif[x] == dif[par[x]] ? anc[par[x]] : par[x];
  }
  lst = nxt[p][w];
}

int main()
{
    int i,j;
    scanf("%s",p+1);
    n=strlen(p+1);
    for(i=1;i<=n;i++)
      if(i&1)
        s[i]=p[i/2+1];
      else
        s[i]=p[n-i/2+1];
  //memset(f, 0x3f, sizeof f);
  lst = cnt = 1, par[0] = 1, par[1] = 0, len[1] = -1, f[0] = 1;
  s[0]=-1;
  for (int i = 1; i <= n; ++i) {
    Extend(s[i] - 'a', i);
    for (int x = lst; x; x = anc[x]) {
      g[x] = f[i - len[anc[x]] - dif[x]];
      if (anc[x] != par[x]) {
        g[x] = (g[x]+g[par[x]])%mod;
      }
      if (!(i & 1)) {
        f[i] = (f[i]+g[x])%mod;
      }
    }
    }
  printf("%d\n",f[n]);
  return 0;
}


#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define fi first
#define se second
#define LL long long
#define sc(x) scanf("%d",&x)
#define scc(x,y) scanf("%d%lld",&x,&y)
#define sccc(x,y,z) scanf("%d%d%d",&x,&y,&z)
using namespace std;

const int mod = 1e9 + 7;
const int N = 2000000;

int dp[N],f[N],nxt[N],d[N],len;
char s[N],ss[N];

struct Palindromic_Tree
{
    int tot,last;
    struct node{int ch[26],fa,len;} T[N];

    inline void init()
    {
        memset(T,0,sizeof(T));nxt[0]=1;
        T[tot=1].len=-1,T[0].fa=T[1].fa=1;
    }

    inline void ins(int c,int n,char *s)
    {
        int p=last;
        while(s[n-T[p].len-1]!=s[n])p=T[p].fa;
        if(!T[p].ch[c])
        {
            int v=++tot,k=T[p].fa;
            T[v].len=T[p].len+2;
            while(s[n-T[k].len-1]!=s[n])k=T[k].fa;
            T[v].fa=T[k].ch[c];T[p].ch[c]=v;
            d[v]=T[v].len-T[T[v].fa].len;
            nxt[v]=d[v]==d[T[v].fa]?nxt[T[v].fa]:T[v].fa;
        }
        last=T[p].ch[c];
    }

}PT;

int main()
{
    scanf("%s",s);
    len=strlen(s);
    if (len&1)
    {
        puts("0");
        return 0;
    }
    dp[0]=1;
    PT.init();
    for(int i=0;i<len;i+=2) ss[i]=s[i/2];
    reverse(s,s+len);
    for(int i=1;i<len;i+=2) ss[i]=s[i/2];
    for(int i=0;i<len;i++)
    {
        PT.ins(ss[i]-'a',i,ss);
        for(int j=PT.last;j;j=nxt[j])
        {
            f[j]=dp[i-PT.T[nxt[j]].len-d[j]+1];
            if (nxt[j]!=PT.T[j].fa) f[j]=(f[j]+f[PT.T[j].fa])%mod;
            if (i&1) dp[i+1]=(dp[i+1]+f[j])%mod;
        }
    }
    printf("%d\n",dp[len]);
    return 0;
}


#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define fi first
#define se second
#define LL long long
#define sc(x) scanf("%d",&x)
#define scc(x,y) scanf("%d%lld",&x,&y)
#define sccc(x,y,z) scanf("%d%d%d",&x,&y,&z)
using namespace std;

const int mod = 1e9 + 7;
const int N = 1000100;

int dp[N],f[N],nxt[N],d[N],len;
char s[N],ss[N];

struct Palindromic_Tree
{
    int tot,last;
    struct node{int ch[26],fa,len;} T[N];

    inline void init()
    {
        memset(T,0,sizeof(T));nxt[0]=1;
        T[tot=1].len=-1,T[0].fa=T[1].fa=1;
    }

    inline void ins(int c,int n,char *s)
    {
        int p=last;
        while(s[n-T[p].len-1]!=s[n])p=T[p].fa;
        if(!T[p].ch[c])
        {
            int v=++tot,k=T[p].fa;
            T[v].len=T[p].len+2;
            while(s[n-T[k].len-1]!=s[n])k=T[k].fa;
            T[v].fa=T[k].ch[c];T[p].ch[c]=v;
            d[v]=T[v].len-T[T[v].fa].len;
            nxt[v]=d[v]==d[T[v].fa]?nxt[T[v].fa]:T[v].fa;
        }
        last=T[p].ch[c];
    }

}PT;

int main()
{
    scanf("%s",s);
    len=strlen(s);
    if (len&1)
    {
        puts("0");
        return 0;
    }
    dp[0]=1;
    PT.init();
    for(int i=0;i<len;i+=2) ss[i]=s[i/2];
    reverse(s,s+len);
    for(int i=1;i<len;i+=2) ss[i]=s[i/2];
    for(int i=0;i<len;i++)
    {
        PT.ins(ss[i]-'a',i,ss);
        for(int j=PT.last;j;j=nxt[j])
        {
            f[j]=dp[i-PT.T[nxt[j]].len-d[j]+1];
            if (nxt[j]!=PT.T[j].fa) f[j]=(f[j]+f[PT.T[j].fa])%mod;
            if (i&1) dp[i+1]=(dp[i+1]+f[j])%mod;
        }
    }
    printf("%d\n",dp[len]);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 3e5 + 1, sigma = 26;
int len[maxn], link[maxn], to[maxn][sigma];
int slink[maxn], diff[maxn], series_ans[maxn];
int sz, last, n;
char s[maxn];

void init()
{
    s[n++] = -1;
    link[0] = 1;
    len[1] = -1;
    sz = 2;
}

int get_link(int v)
{
    while(s[n - len[v] - 2] != s[n - 1]) v = link[v];
    return v;
}

void add_letter(char c)
{
    s[n++] = c -= 'a';
    last = get_link(last);
    if(!to[last][c])
    {
        len[sz] = len[last] + 2;
        link[sz] = to[get_link(link[last])][c];
        diff[sz] = len[sz] - len[link[sz]];
        if(diff[sz] == diff[link[sz]])
            slink[sz] = slink[link[sz]];
        else
            slink[sz] = link[sz];
        to[last][c] = sz++;
    }
    last = to[last][c];
}

const int md = 1e9 + 7;

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  init();
  string f, _s;
  cin >> _s;
  int n = _s.length();
  for(int i = 0; i < n; i++) {
    if(i & 1) f += _s[n - 1 - i / 2];
    else f += _s[i / 2];
  }
  vector<int> ans(n + 1);
  ans[0] = 1;
  for(int i = 1; i <= n; i++) {
    add_letter(f[i - 1]);
    for(int v = last; len[v] > 0; v = slink[v]) {
      series_ans[v] = ans[i - (len[slink[v]] + diff[v])];
        if(diff[v] == diff[link[v]])
          series_ans[v] = (series_ans[v] + series_ans[link[v]]) % md;
      ans[i] = (ans[i] + series_ans[v]) % md;
    }
    if(i & 1) ans[i] = 0;
  }
  cout << ans[n];
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 5, sigma = 26;
int len[maxn], link[maxn], to[maxn][sigma];
int slink[maxn], diff[maxn], series_ans[maxn];
int sz, last, n;
char s[maxn];

void init() {
  s[n++] = -1;
  link[0] = 1;
  len[1] = -1;
  sz = 2;
}

int get_link(int v) {
  while(s[n - len[v] - 2] != s[n - 1]) v = link[v];
  return v;
}

void add_letter(char c) {
  s[n++] = c -= 'a';
  last = get_link(last);
  if(!to[last][c]) {
    len[sz] = len[last] + 2;
    link[sz] = to[get_link(link[last])][c];
    diff[sz] = len[sz] - len[link[sz]];
    if(diff[sz] == diff[link[sz]])
      slink[sz] = slink[link[sz]];
    else
      slink[sz] = link[sz];
    to[last][c] = sz++;
  }
  last = to[last][c];
}

char f[maxn];
const int md = 1e9 + 7;

void dp(int i, vector<int> &ans) {
  add_letter(f[i - 1]);
  for(int v = last; len[v] > 0; v = slink[v]) {
    series_ans[v] = ans[i - (len[slink[v]] + diff[v])];
      if(diff[v] == diff[link[v]])
        series_ans[v] = (series_ans[v] + series_ans[link[v]]) % md;
    ans[i] = (ans[i] + series_ans[v]) % md;
  }
}

int main()
{
  init();
  char _s[maxn];
  scanf("%s", _s);
  int n = strlen(_s);
  for(int i = 0; i < n; i++) {
    if(i & 1) f[i] = _s[n - 1 - i / 2];
    else f[i] = _s[i / 2];
  }
  vector<int> ans(n + 1);
  ans[0] = 1;
  for(int i = 1; i <= n; i++) {
    dp(i, ans);
    if(i & 1) ans[i] = 0;
  }
  cout << ans[n];
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6 + 5, sigma = 26;
int len[maxn], link[maxn], to[maxn][sigma];
int slink[maxn], diff[maxn], series_ans[maxn];
int sz, last, n;
char s[maxn];

void init()
{
    s[n++] = -1;
    link[0] = 1;
    len[1] = -1;
    sz = 2;
}

int get_link(int v)
{
    while(s[n - len[v] - 2] != s[n - 1]) v = link[v];
    return v;
}

void add_letter(char c)
{
    s[n++] = c -= 'a';
    last = get_link(last);
    if(!to[last][c])
    {
        len[sz] = len[last] + 2;
        link[sz] = to[get_link(link[last])][c];
        diff[sz] = len[sz] - len[link[sz]];
        if(diff[sz] == diff[link[sz]])
            slink[sz] = slink[link[sz]];
        else
            slink[sz] = link[sz];
        to[last][c] = sz++;
    }
    last = to[last][c];
}

const int md = 1e9 + 7;

int main()
{
  init();
  char _s[maxn];
  string f;
  scanf("%s", _s);
  int n = strlen(_s);
  for(int i = 0; i < n; i++) {
    if(i & 1) f += _s[n - 1 - i / 2];
    else f += _s[i / 2];
  }
  vector<int> ans(n + 1);
  ans[0] = 1;
  for(int i = 1; i <= n; i++) {
    add_letter(f[i - 1]);
    for(int v = last; len[v] > 0; v = slink[v]) {
      series_ans[v] = ans[i - (len[slink[v]] + diff[v])];
        if(diff[v] == diff[link[v]])
          series_ans[v] = (series_ans[v] + series_ans[link[v]]) % md;
      ans[i] = (ans[i] + series_ans[v]) % md;
    }
    if(i & 1) ans[i] = 0;
  }
  cout << ans[n];
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int B = 26;
const int N = 2e6 + 10;
const char O = 'a';

int ch[N][B], link[N], len[N];
int dif[N], slink[N];

namespace pam {
char s[N];
int nc = 0, lst = 0, sc = 0;

int np (int _len, int _f) {
	nc ++;
	for (int i = 0; i < B; i ++)
		ch[nc][i] = 0;
	len[nc] = _len;
	link[nc] = _f;
	return nc;
}

int gf (int p) {
	for (; s[sc - len[p] - 1] != s[sc]; p = link[p]);
	return p;
}

void clear (void) { nc = -1; lst = sc = 0; np(0, 1); np(-1, 0); }

void extend (char _ch) {
	int p = lst, o = (s[++ sc] = _ch) - O;
	if (!ch[p = gf(p)][o]) {
		ch[p][o] = np(len[p] + 2, ch[gf(link[p])][o]);
		int q = ch[p][o];
		dif[q] = len[q] - len[link[q]];
		if (dif[q] == dif[link[q]]) slink[q] = slink[link[q]];
		else slink[q] = link[q];
	}
	lst = ch[p][o];
}

};

const int mod = 1e9 + 7;

int add (int a, int b) { return (a += b) >= mod ? a - mod : a; }

char s[N], t[N];
int dp[N], g[N];

int main (void) {
	scanf("%s", s + 1);
	int n = strlen(s + 1);
	pam::clear();
	int m = 0;
	for (int i = 1; i <= n / 2; i ++) {
		t[++ m] = s[i];
		t[++ m] = s[n - i + 1];
	}
	dp[0] = 1;
	for (int i = 1; i <= n; i ++) {
		pam::extend(t[i]);
		for (int p = pam::lst; p > 1; p = slink[p]) {
			g[p] = dp[i - len[slink[p]] - dif[p]];
			if (link[p] != slink[p]) g[p] = add(g[p], g[link[p]]);
			if (i % 2 == 0) dp[i] = add(dp[i], g[p]);
		}
		// for (int p = pam::lst; p > 1; p = link[p]) if (i % 2 == 0) {
		// 	dp[i] = add(dp[i], dp[i - len[p]]);
		// }
	}
	// cout << pam::nc << endl;
	// for (int i = 2; i <= pam::nc; i ++) {
	// 	cout << i << " " << len[i] << " " << link[i] << endl;
	// }
	printf("%d\n", dp[n]);
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<bitset>
#include<map>
#include<unordered_map>
#include<set>
#include<list>
#define ui unsigned int
#define ll long long
#define llu unsigned ll
#define ld long double
#define pr make_pair
#define pb push_back
#define lc (cnt<<1)
#define rc (cnt<<1|1)
//#define len(x)  (t[(x)].r-t[(x)].l+1)
#define tmid ((l+r)>>1)
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
using namespace std;

const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
const double dnf=1e18;
const int mod=1e9+7;
const double eps=1e-5;
const double pi=acos(-1.0);
const int hp=13331;
const int maxn=1000100;
const int maxp=1100;
const int maxm=4000100;
const int up=1000;
const int N=26;

struct Palindromic_Tree
{
    int t[maxn][N];
    int fail[maxn];
    int cnt[maxn];
    int num[maxn];
    int len[maxn];
    int S[maxn];
    int last;
    int n;
    int p;

    int newnode(int l)
    {
        for(int i=0;i<N;++i) t[p][i]=0;
        cnt[p]=0;
        num[p]=0;
        len[p]=l;
        return p++;
    }

    void init(void)
    {
        p=0;
        newnode(0);
        newnode(-1);
        last=0;
        n=0;
        S[n]=-1;
        fail[0]=1;
    }

    int get_fail(int x)
    {
        while(S[n-len[x]-1]!=S[n]) x=fail[x];
        return x;
    }

    void add(int c)
    {
        c-='a';
        S[++n]=c;
        int cur=get_fail(last);
        if(!t[cur][c])
        {
            int now=newnode(len[cur]+2);
            fail[now]=t[get_fail(fail[cur])][c];
            t[cur][c]=now;
            num[now]=num[fail[now]]+1;
        }
        last=t[cur][c];
        cnt[last]++;
    }

    void _count(void)
    {
        for(int i=p-1;i>=0;--i) cnt[fail[i]]+=cnt[i];
    }
}pam;

int dp[maxn];
char str[maxn],s[maxn];

int main(void)
{
    scanf("%s",str+1);
    int n=strlen(str+1);
    if(n&1)
    {
        printf("0\n");
        return 0;
    }
    int cnt=0;
    int l=1,r=n;
    for(int i=1;i<=n/2;i++)
        s[++cnt]=str[l++],s[++cnt]=str[r--];

    pam.init();
    dp[0]=1;
    for(int i=1;i<=n;i++)
    {
        pam.add(s[i]);
        int p=pam.last;
        while(p!=0&&p!=1)
        {
            if(pam.len[p]%2==0) dp[i]=(dp[i]+dp[i-pam.len[p]])%mod;
            p=pam.fail[p];
        }
    }
    printf("%d\n",dp[n]);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<queue>
#include<bitset>
#include<map>
#include<unordered_map>
#include<set>
#include<list>
#define ui unsigned int
#define ll long long
#define llu unsigned ll
#define ld long double
#define pr make_pair
#define pb push_back
#define lc (cnt<<1)
#define rc (cnt<<1|1)
//#define len(x)  (t[(x)].r-t[(x)].l+1)
#define tmid ((l+r)>>1)
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)>(y)?(y):(x))
using namespace std;

const int inf=0x3f3f3f3f;
const ll lnf=0x3f3f3f3f3f3f3f3f;
const double dnf=1e18;
const int mod=1e9+7;
const double eps=1e-5;
const double pi=acos(-1.0);
const int hp=13331;
const int maxn=1000100;
const int maxp=1100;
const int maxm=4000100;
const int up=1000;
const int N=26;

struct Palindromic_Tree
{
    int t[maxn][N];
    int fail[maxn];
    int cnt[maxn];
    int num[maxn];
    int len[maxn];
    int S[maxn];
    int di[maxn];//节点x与fail[x]长度之差
    int pre[maxn];//上一个等差序列的最后一项。
    int last;
    int n;
    int p;

    int newnode(int l)
    {
        for(int i=0;i<N;++i) t[p][i]=0;
        cnt[p]=0;
        num[p]=0;
        len[p]=l;
        return p++;
    }

    void init(void)
    {
        p=0;
        newnode(0);
        newnode(-1);
        last=0;
        n=0;
        S[n]=-1;
        fail[0]=1;
        pre[0]=1;
    }

    int get_fail(int x)
    {
        while(S[n-len[x]-1]!=S[n]) x=fail[x];
        return x;
    }

    void add(int c)
    {
        c-='a';
        S[++n]=c;
        int cur=get_fail(last);
        if(!t[cur][c])
        {
            int now=newnode(len[cur]+2);
            fail[now]=t[get_fail(fail[cur])][c];
            t[cur][c]=now;
            num[now]=num[fail[now]]+1;
            di[now]=len[now]-len[fail[now]];
            pre[now]=(di[now]==di[fail[now]])?pre[fail[now]]:fail[now];
        }
        last=t[cur][c];
        cnt[last]++;
    }

    void _count(void)
    {
        for(int i=p-1;i>=0;--i) cnt[fail[i]]+=cnt[i];
    }
}pam;

int dp[maxn],g[maxn];
char str[maxn],s[maxn];

int main(void)
{
    scanf("%s",str+1);
    int n=strlen(str+1);
    if(n&1)
    {
        printf("0\n");
        return 0;
    }
    int cnt=0;
    int l=1,r=n;
    for(int i=1;i<=n/2;i++)
        s[++cnt]=str[l++],s[++cnt]=str[r--];

    pam.init();
    dp[0]=1;
    for(int i=1;i<=n;i++)
    {
        pam.add(s[i]);
        for(int p=pam.last;p!=1&&p!=0;p=pam.pre[p])
        {
            g[p]=dp[i-pam.len[pam.pre[p]]-pam.di[p]];
            if(pam.fail[p]!=pam.pre[p])
                g[p]=(g[p]+g[pam.fail[p]])%mod;
            //只计算长度为偶数的回文串
            if(i%2==0) dp[i]=(dp[i]+g[p])%mod;
        }
    }
    printf("%d\n",dp[n]);
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
inline void Add(int &a,int b)
{a+=b;a>=MOD?a-=MOD:1;}
inline void Sub(int a,int b)
{a-=b;a<0?a+=MOD:1;}
inline int add(int a,int b)
{a+=b;return a>=MOD?a-MOD:a;}
const int Q=1<<20;
char ss[Q],s[Q];
struct dt{
	int st,d,num;
	int sm;
};
vector<dt> g,mem,u;
ll ID(int st,int d,int num)
{return 2000000000000LL*st+1000005LL*d+num;}
unordered_map<ll,int> rem;
int f[Q];
int G(int st,int d,int num)
{
	if(num==1)return f[st-1];
	ll dd=ID(st,d,num);
	int val=rem[dd];
	if(val)return val-1;
	val=add(G(st,d,num-1),f[st+(num-1)*d-1]);
	rem[dd]=val+1;
	return val;
}
void Upd(dt h)
{rem[ID(h.st,h.d,h.num)]=h.sm+1;}
void Get(dt &h)
{h.sm=G(h.st,h.d,h.num);}
int main()
{
	scanf("%s",ss+1);
	int nn=strlen(ss+1),n=0;
	for(int i=1,j=nn;i<j;i++,j--)
		s[++n]=ss[i],s[++n]=ss[j];
	s[0]='#',s[n+1]='&';
	f[0]=1;
	for(int i=1;i<=n;i++){
		mem.clear();
		for(dt h:g)
			if(s[i]==s[h.st-1]){
				if(s[i]!=s[h.st+h.d-1])mem.push_back((dt){h.st-1,-1,1,f[h.st-2]});
				else --h.st,Get(h),mem.push_back(h);
			}
			else{
				if(h.num==1)continue;
				Sub(h.sm,f[h.st-1]);
				h.st+=h.d,--h.num;
				Upd(h);
				if(s[i]==s[h.st-1])--h.st,Get(h),mem.push_back(h);
			}
		if(s[i]==s[i-1])mem.push_back((dt){i-1,-1,1,f[i-2]});
		mem.push_back((dt){i,-1,1,f[i-1]});
		for(int j=0;j<(int)mem.size()-1;j++)
			if(mem[j].num==1)mem[j].d=mem[j+1].st-mem[j].st;
		u.clear();
		for(int j=0;j<(int)mem.size();j++)
			if(mem[j].num==1)u.push_back(mem[j]);
			else{
				dt h=mem[j];
				int mr=h.st+(h.num-1)*h.d;
				if(h.d!=mem[j+1].st-mr){
					Sub(h.sm,f[mr-1]);
					--h.num;
					Upd(h);
					u.push_back(h);
					u.push_back((dt){mr,mem[j+1].st-mr,1,f[mr-1]});
				}
				else u.push_back(h);
			}
		g.clear();
		int tp=-1;
		for(int j=0;j<(int)u.size();j++)
			if(tp<0||g[tp].d!=u[j].d)g.push_back(u[j]),++tp;
			else Add(g[tp].sm,u[j].sm),g[tp].num+=u[j].num,Upd(g[tp]);
		if((i&1)^1)
			for(dt h:g)
				Add(f[i],h.sm);
	}
	printf("%d\n",f[n]);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
inline void Add(int &a,int b)
{a+=b;a>=MOD?a-=MOD:1;}
inline void Sub(int a,int b)
{a-=b;a<0?a+=MOD:1;}
inline int add(int a,int b)
{a+=b;return a>=MOD?a-MOD:a;}
const int Q=1<<20;
char ss[Q],s[Q];
struct dt{
	int st,d,num;
	int sm;
};
vector<dt> g,mem,u;
ll ID(int st,int d,int num)
{return 2000000000000LL*st+1000005LL*d+num;}
unordered_map<ll,int> rem;
int f[Q];
int G(int st,int d,int num)
{
	if(num==1)return f[st-1];
	ll dd=ID(st,d,num);
	int val=rem[dd];
	if(val)return val-1;
	val=add(G(st,d,num-1),f[st+(num-1)*d-1]);
	rem[dd]=val+1;
	return val+1;
}
void Upd(dt h)
{rem[ID(h.st,h.d,h.num)]=h.sm+1;}
void Get(dt &h)
{h.sm=G(h.st,h.d,h.num);}
int main()
{
	scanf("%s",ss+1);
	int nn=strlen(ss+1),n=0;
	for(int i=1,j=nn;i<j;i++,j--)
		s[++n]=ss[i],s[++n]=ss[j];
	s[0]='#',s[n+1]='&';
	f[0]=1;
	for(int i=1;i<=n;i++){
		mem.clear();
		for(dt h:g)
			if(s[i]==s[h.st-1]){
				if(s[i]!=s[h.st+h.d-1])mem.push_back((dt){h.st-1,-1,1,f[h.st-2]});
				else --h.st,Get(h),mem.push_back(h);
			}
			else{
				if(h.num==1)continue;
				Sub(h.sm,f[h.st-1]);
				h.st+=h.d,--h.num;
				Upd(h);
				if(s[i]==s[h.st-1])--h.st,Get(h),mem.push_back(h);
			}
		if(s[i]==s[i-1])mem.push_back((dt){i-1,-1,1,f[i-2]});
		mem.push_back((dt){i,-1,1,f[i-1]});
		for(int j=0;j<(int)mem.size()-1;j++)
			if(mem[j].num==1)mem[j].d=mem[j+1].st-mem[j].st;
		u.clear();
		for(int j=0;j<(int)mem.size();j++)
			if(mem[j].num==1)u.push_back(mem[j]);
			else{
				dt h=mem[j];
				int mr=h.st+(h.num-1)*h.d;
				if(h.d!=mem[j+1].st-mr){
					Sub(h.sm,f[mr-1]);
					--h.num;
					Upd(h);
					u.push_back(h);
					u.push_back((dt){mr,mem[j+1].st-mr,1,f[mr-1]});
				}
				else u.push_back(h);
			}
		g.clear();
		int tp=-1;
		for(int j=0;j<(int)u.size();j++)
			if(tp<0||g[tp].d!=u[j].d)g.push_back(u[j]),++tp;
			else Add(g[tp].sm,u[j].sm),g[tp].num+=u[j].num,Upd(g[tp]);
		if((i&1)^1)
			for(dt h:g)
				Add(f[i],h.sm);
	}
	printf("%d\n",f[n]);
	return 0;
}


#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#include <ext/rope>
//#include <ext/pb_ds/priority_queue.hpp>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
//using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define eps 1e-8
const double pi = acos(-1.0);

typedef long long LL;
typedef long long DLL;
typedef unsigned long long ULL;
void umax(LL &a, LL b) {
    a = max(a, b);
}
void umin(LL &a, LL b) {
    a = min(a, b);
}
int dcmp(double x) {
    return fabs(x) <= eps?0:(x > 0?1:-1);
}

DLL mod = 1e9;

DLL Pow(DLL a,DLL b) {
    DLL res=1;
    a%=mod;
    for(; b; b>>=1) {
        if(b&1)res=res*a%mod;
        a=a*a%mod;
    }
    return res;
}
//
//void print(DLL x) {
//    if(x < 0) {
//        x = -x;
//        putchar('-');
//    }
//    if(x > 9) print(x/10);
//    putchar(x%10 + '0');
//}
//#define iostart
//#define iostart
#define pb(x) push_back(x)
namespace solver {
    namespace ds {
        const int N=1000010,S=26;
        const LL mod = 1e9+7;
        LL dp[N];
        LL addv(LL a, LL b) {
            a += b;
            return a % mod;
        }
        char s[N];
        struct DS{
          int all,son[N][S],fail[N],len[N],diff[N],top[N],text[N],last,tot, f[N], times[N];
          //
          int newnode(int l){
            for(int i=0;i<S;i++)son[tot][i]=0;
            fail[tot]=diff[tot]=top[tot]=0,len[tot]=l,times[tot]=0;
            return tot++;
          }
          void init(){
            last=tot=all=0;
            newnode(0),newnode(-1);
            text[0]=-1,fail[0]=1;
          }
          int getfail(int x){
            while(text[all-len[x]-1]!=text[all])x=fail[x];
            return x;
          }
          void add(int w, int pos){
            w-='a';
            text[++all]=w;
            int x=getfail(last);
            if(!son[x][w]){
              int y=newnode(len[x]+2);
              int z=son[getfail(fail[x])][w];
              son[x][w]=y;
              fail[y]=z;
              diff[y]=len[y]-len[z];
              if(diff[y]!=diff[z]||len[z]<1) {
                top[y]=y;
              }
              else {
                top[y]=top[z];
              }
              //如果差值不相同，就开新的等差数列
            }
            last=son[x][w];
            f[all]=last;
          }
          void get(int x,int&cnt){
            cnt=0;
            int pos = x;
            x=f[x];
            while(len[x]>0){
              int y=top[x];
              if (x == y) {
                if (len[x] % 2 == 0) {
                    times[x] = dp[pos - len[x]];
                }
                times[x] = addv(times[x], times[fail[x]]);
              } else {
                times[x] = dp[pos - len[x]];
              }
              if (pos % 2 == 0){
                dp[pos] += times[x];
//                cout << dp[pos] << " debug " << pos << endl;
              }
              /*
              长度为len[y]~len[x]的后缀都是回文后缀
              能够组成最多log个等差数列的形式,按照结构体的形式存储
              len[y]是起始长度, len[x]是最后一个位置的长度，diff[x]是公差，(len[x]-len[y])/diff[x]+1是数列长度
              */
              //printf("! %d %d %d %d\n",len[y],len[x],diff[x],(len[x]-len[y])/diff[x]);
              x=fail[y];
            }
          }
        } suf;
        void build(string str) {
            suf.init();
            dp[0] = 1;
            for (int i = 0; i < str.size(); i++) {
                suf.add(str[i], i + 1);
                int ca;
                suf.get(i+1, ca);
            }
            printf("%lld\n", dp[str.size()]);
        }
    };

    void solve() {
        string s1, s2;
        cin >> s1;
        s2 = s1;
        reverse(all(s2));
        string ss;
        for (int i = 0; i < s1.size()/2; i++) {
            ss += s1[i];
            ss += s2[i];
        }
//        cout << ss <<endl;
        ds::build(ss);
    }
};

int main() {
#ifdef iostart
    ios::sync_with_stdio(0);
    cin.tie(0);
#endif // iostart
//    file();
    solver::solve();
    return 0;
}

/*
4 3
1 2 10
2 3 4
3 4 1
2
1 4
*/


#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#include <ext/rope>
//#include <ext/pb_ds/priority_queue.hpp>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
//using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define eps 1e-8
const double pi = acos(-1.0);

typedef long long LL;
typedef long long DLL;
typedef unsigned long long ULL;
void umax(LL &a, LL b) {
    a = max(a, b);
}
void umin(LL &a, LL b) {
    a = min(a, b);
}
int dcmp(double x) {
    return fabs(x) <= eps?0:(x > 0?1:-1);
}

DLL mod = 1e9;

DLL Pow(DLL a,DLL b) {
    DLL res=1;
    a%=mod;
    for(; b; b>>=1) {
        if(b&1)res=res*a%mod;
        a=a*a%mod;
    }
    return res;
}
//
//void print(DLL x) {
//    if(x < 0) {
//        x = -x;
//        putchar('-');
//    }
//    if(x > 9) print(x/10);
//    putchar(x%10 + '0');
//}
//#define iostart
//#define iostart
#define pb(x) push_back(x)
namespace solver {
    namespace ds {
        const int N=1000010,S=26;
        const LL mod = 1e9+7;
        LL dp[N];
        LL addv(LL a, LL b) {
            a += b;
            return a % mod;
        }
        char s[N];
        struct DS{
          int all,son[N][S],fail[N],len[N],diff[N],top[N],text[N],last,tot, f[N], times[N];
          //
          int newnode(int l){
            for(int i=0;i<S;i++)son[tot][i]=0;
            fail[tot]=diff[tot]=top[tot]=0,len[tot]=l,times[tot]=0;
            return tot++;
          }
          void init(){
            last=tot=all=0;
            newnode(0),newnode(-1);
            text[0]=-1,fail[0]=1;
          }
          int getfail(int x){
            while(text[all-len[x]-1]!=text[all])x=fail[x];
            return x;
          }
          void add(int w, int pos){
            w-='a';
            text[++all]=w;
            int x=getfail(last);
            if(!son[x][w]){
              int y=newnode(len[x]+2);
              int z=son[getfail(fail[x])][w];
              son[x][w]=y;
              fail[y]=z;
              diff[y]=len[y]-len[z];
              if(diff[y]!=diff[z]||len[z]<1) {
                top[y]=y;
              }
              else {
                top[y]=top[z];
              }
              //如果差值不相同，就开新的等差数列
            }
            last=son[x][w];
            f[all]=last;
          }
          void get(int x,int&cnt){
            cnt=0;
            int pos = x;
            x=f[x];
            while(len[x]>0){
              int y=top[x];
              if (x != y) {
                if (len[x] % 2 == 0) {
                    times[x] = dp[pos - len[x]];
                }
                times[x] = addv(times[x], times[fail[x]]);
//                cout << times[x] << " 11 "<< times[fail[x]] << " " << x << " "<<fail[x]<< endl;
              } else {
                  if (len[x] % 2 == 0)
                    times[x] = dp[pos - len[x]];
              }
              if (pos % 2 == 0){
                dp[pos] += times[x];
//                cout << dp[pos] << " debug " << pos << " " << times[x] << " " << (x != y) << " " <<len[x] << " " <<len[y]<<endl;
              }
              /*
              长度为len[y]~len[x]的后缀都是回文后缀
              能够组成最多log个等差数列的形式,按照结构体的形式存储
              len[y]是起始长度, len[x]是最后一个位置的长度，diff[x]是公差，(len[x]-len[y])/diff[x]+1是数列长度
              */
              //printf("! %d %d %d %d\n",len[y],len[x],diff[x],(len[x]-len[y])/diff[x]);
              x=fail[y];
            }
          }
        } suf;
        void build(string str) {
//            cout <<str << endl;
            suf.init();
            dp[0] = 1;
            for (int i = 0; i < str.size(); i++) {
                suf.add(str[i], i + 1);
                int ca;
                suf.get(i+1, ca);
            }
            printf("%lld\n", dp[str.size()]);
        }
    };

    void solve() {
        string s1, s2;
        cin >> s1;
        s2 = s1;
        reverse(all(s2));
        string ss;
        for (int i = 0; i < s1.size()/2; i++) {
            ss += s1[i];
            ss += s2[i];
        }
//        cout << ss <<endl;
        ds::build(ss);
    }
};

int main() {
#ifdef iostart
    ios::sync_with_stdio(0);
    cin.tie(0);
#endif // iostart
//    file();
    solver::solve();
    return 0;
}

/*
4 3
1 2 10
2 3 4
3 4 1
2
1 4
*/


#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#include <ext/rope>
//#include <ext/pb_ds/priority_queue.hpp>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
//using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define eps 1e-8
const double pi = acos(-1.0);

typedef long long LL;
typedef long long DLL;
typedef unsigned long long ULL;
void umax(LL &a, LL b) {
    a = max(a, b);
}
void umin(LL &a, LL b) {
    a = min(a, b);
}
int dcmp(double x) {
    return fabs(x) <= eps?0:(x > 0?1:-1);
}

DLL mod = 1e9;

DLL Pow(DLL a,DLL b) {
    DLL res=1;
    a%=mod;
    for(; b; b>>=1) {
        if(b&1)res=res*a%mod;
        a=a*a%mod;
    }
    return res;
}
//
//void print(DLL x) {
//    if(x < 0) {
//        x = -x;
//        putchar('-');
//    }
//    if(x > 9) print(x/10);
//    putchar(x%10 + '0');
//}
//#define iostart
//#define iostart
#define pb(x) push_back(x)
namespace solver {
    namespace ds {
        const int N=2000010,S=26;
        const LL mod = 1e9+7;
        LL dp[N];
        LL addv(LL a, LL b) {
            a += b;
            return a % mod;
        }
        char s[N];
        struct AP{
          int tp, s,d,r,f;
          //k*d+s 0<=k<=r
          AP(){}
          AP(int _s,int _d,int _r,int _f){s=_s,d=_d,r=_r,f=_f;}
        }a[N];
        struct DS{
          int all,son[N][S],fail[N],len[N],diff[N],top[N],text[N],last,tot, f[N], times[N];
          //
          int newnode(int l){
            for(int i=0;i<S;i++)son[tot][i]=0;
            fail[tot]=diff[tot]=top[tot]=0,len[tot]=l,times[tot]=0;
            return tot++;
          }
          void init(){
            last=tot=all=0;
            newnode(0),newnode(-1);
            text[0]=-1,fail[0]=1;
          }
          int getfail(int x){
            while(text[all-len[x]-1]!=text[all])x=fail[x];
            return x;
          }
          void add(int w, int pos){
            w-='a';
            text[++all]=w;
            int x=getfail(last);
            if(!son[x][w]){
              int y=newnode(len[x]+2);
              int z=son[getfail(fail[x])][w];
              son[x][w]=y;
              fail[y]=z;
              diff[y]=len[y]-len[z];
              if(diff[y]!=diff[z]||len[z]<1) {
                top[y]=y;
              }
              else {
                top[y]=top[z];
              }
              //如果差值不相同，就开新的等差数列
            }
            last=son[x][w];
            f[all]=last;
          }
          void get(int x,AP q[],int&cnt){
            cnt=0;
            int pos = x;
            x=f[x];
            while(len[x]>0){
              int y=top[x];
              q[++cnt]=AP(len[y],diff[x],(len[x]-len[y])/diff[x],len[x]);
              if (x == y) {
                if (len[x] % 2 == 0) {
                    times[x] = dp[pos - len[x]];
                }
                times[x] = addv(times[x], times[fail[x]]);
              } else {
                times[x] = dp[pos - len[x]];
              }
              if (pos % 2 == 0){
                dp[pos] += times[x];
//                cout << dp[pos] << " debug " << pos << endl;
              }
              /*
              长度为len[y]~len[x]的后缀都是回文后缀
              能够组成最多log个等差数列的形式,按照结构体的形式存储
              len[y]是起始长度, len[x]是最后一个位置的长度，diff[x]是公差，(len[x]-len[y])/diff[x]+1是数列长度
              */
              //printf("! %d %d %d %d\n",len[y],len[x],diff[x],(len[x]-len[y])/diff[x]);
              x=fail[y];
            }
          }
        } suf;
        void build(string str) {
            suf.init();
            dp[0] = 1;
            for (int i = 0; i < str.size(); i++) {
                suf.add(str[i], i + 1);
                int ca;
                suf.get(i+1, a, ca);
            }
            printf("%lld\n", dp[str.size()]);
        }
    };

    void solve() {
        string s1, s2;
        cin >> s1;
        s2 = s1;
        reverse(all(s2));
        string ss;
        for (int i = 0; i < s1.size()/2; i++) {
            ss += s1[i];
            ss += s2[i];
        }
//        cout << ss <<endl;
        ds::build(ss);
    }
};

int main() {
#ifdef iostart
    ios::sync_with_stdio(0);
    cin.tie(0);
#endif // iostart
//    file();
    solver::solve();
    return 0;
}

/*
4 3
1 2 10
2 3 4
3 4 1
2
1 4
*/


#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#include <ext/rope>
//#include <ext/pb_ds/priority_queue.hpp>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
//using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define eps 1e-8
const double pi = acos(-1.0);

typedef long long LL;
typedef long long DLL;
typedef unsigned long long ULL;
void umax(LL &a, LL b) {
    a = max(a, b);
}
void umin(LL &a, LL b) {
    a = min(a, b);
}
int dcmp(double x) {
    return fabs(x) <= eps?0:(x > 0?1:-1);
}

DLL mod = 1e9;

DLL Pow(DLL a,DLL b) {
    DLL res=1;
    a%=mod;
    for(; b; b>>=1) {
        if(b&1)res=res*a%mod;
        a=a*a%mod;
    }
    return res;
}
//
//void print(DLL x) {
//    if(x < 0) {
//        x = -x;
//        putchar('-');
//    }
//    if(x > 9) print(x/10);
//    putchar(x%10 + '0');
//}
//#define iostart
//#define iostart
#define pb(x) push_back(x)
namespace solver {
    namespace ds {
        const int N=1000010,S=26;
        const LL mod = 1e9+7;
        LL dp[N];
        LL addv(LL a, LL b) {
            a += b;
            return a % mod;
        }
        char s[N];
        struct DS{
          int all,son[N][S],fail[N],len[N],diff[N],top[N],text[N],last,tot, f[N], times[N];
          //
          int newnode(int l){
            for(int i=0;i<S;i++)son[tot][i]=0;
            fail[tot]=diff[tot]=top[tot]=0,len[tot]=l,times[tot]=0;
            return tot++;
          }
          void init(){
            last=tot=all=0;
            newnode(0),newnode(-1);
            text[0]=-1,fail[0]=1;
          }
          int getfail(int x){
            while(text[all-len[x]-1]!=text[all])x=fail[x];
            return x;
          }
          void add(int w, int pos){
            w-='a';
            text[++all]=w;
            int x=getfail(last);
            if(!son[x][w]){
              int y=newnode(len[x]+2);
              int z=son[getfail(fail[x])][w];
              son[x][w]=y;
              fail[y]=z;
              diff[y]=len[y]-len[z];
              if(diff[y]!=diff[z]||len[z]<1) {
                top[y]=y;
              }
              else {
                top[y]=top[z];
              }
              //如果差值不相同，就开新的等差数列
            }
            last=son[x][w];
            f[all]=last;
          }
          void get(int x,int&cnt){
            cnt=0;
            int pos = x;
            x=f[x];
            while(len[x]>0){
              int y=top[x];
              if (x != y) {
                times[x] = dp[pos - len[y]];
                times[x] = addv(times[x], times[fail[x]]);
              } else {
                times[x] = dp[pos - len[x]];
              }
              if (pos % 2 == 0)
                dp[pos] = addv(dp[pos], times[x]);
              /*
              长度为len[y]~len[x]的后缀都是回文后缀
              能够组成最多log个等差数列的形式,按照结构体的形式存储
              len[y]是起始长度, len[x]是最后一个位置的长度，diff[x]是公差，(len[x]-len[y])/diff[x]+1是数列长度
              */
//              printf("! %d %d %d %d\n",len[y],len[x],diff[x],pos);
              x=fail[y];
            }
          }
        } suf;
        void build(string str) {
//            cout <<str << endl;
            suf.init();
            dp[0] = 1;
            for (int i = 0; i < str.size(); i++) {
                suf.add(str[i], i + 1);
                int ca;
                suf.get(i+1, ca);
            }
            printf("%lld\n", dp[str.size()]);
        }
    };

    void solve() {
        string s1, s2;
        cin >> s1;
        s2 = s1;
        reverse(all(s2));
        string ss;
        for (int i = 0; i < s1.size()/2; i++) {
            ss += s1[i];
            ss += s2[i];
        }
//        cout << ss <<endl;
        ds::build(ss);
    }
};

int main() {
#ifdef iostart
    ios::sync_with_stdio(0);
    cin.tie(0);
#endif // iostart
//    file();
    solver::solve();
    return 0;
}

/*
4 3
1 2 10
2 3 4
3 4 1
2
1 4
*/


#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#include <ext/rope>
//#include <ext/pb_ds/priority_queue.hpp>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
//using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define eps 1e-8
const double pi = acos(-1.0);

typedef long long LL;
typedef long long DLL;
typedef unsigned long long ULL;
void umax(LL &a, LL b) {
    a = max(a, b);
}
void umin(LL &a, LL b) {
    a = min(a, b);
}
int dcmp(double x) {
    return fabs(x) <= eps?0:(x > 0?1:-1);
}

DLL mod = 1e9;

DLL Pow(DLL a,DLL b) {
    DLL res=1;
    a%=mod;
    for(; b; b>>=1) {
        if(b&1)res=res*a%mod;
        a=a*a%mod;
    }
    return res;
}
//
//void print(DLL x) {
//    if(x < 0) {
//        x = -x;
//        putchar('-');
//    }
//    if(x > 9) print(x/10);
//    putchar(x%10 + '0');
//}
//#define iostart
//#define iostart
#define pb(x) push_back(x)
namespace solver {
    namespace ds {
        const int N=1000010,S=26;
        const LL mod = 1e9+7;
        LL dp[N];
        LL addv(LL a, LL b) {
            a += b;
            return a % mod;
        }
        char s[N];
        struct DS{
          int all,son[N][S],fail[N],len[N],diff[N],top[N],text[N],last,tot, f[N], times[N];
          //
          int newnode(int l){
            for(int i=0;i<S;i++)son[tot][i]=0;
            fail[tot]=diff[tot]=top[tot]=0,len[tot]=l,times[tot]=0;
            return tot++;
          }
          void init(){
            last=tot=all=0;
            newnode(0),newnode(-1);
            text[0]=-1,fail[0]=1;
          }
          int getfail(int x){
            while(text[all-len[x]-1]!=text[all])x=fail[x];
            return x;
          }
          void add(int w, int pos){
            w-='a';
            text[++all]=w;
            int x=getfail(last);
            if(!son[x][w]){
              int y=newnode(len[x]+2);
              int z=son[getfail(fail[x])][w];
              son[x][w]=y;
              fail[y]=z;
              diff[y]=len[y]-len[z];
              if(diff[y]!=diff[z]||len[z]<1) {
                top[y]=y;
              }
              else {
                top[y]=top[z];
              }
              //如果差值不相同，就开新的等差数列
            }
            last=son[x][w];
            f[all]=last;
          }
          void get(int x,int&cnt){
            cnt=0;
            int pos = x;
            x=f[x];
            while(len[x]>0){
//              int y=top[x];
//              if (x != y) {
//                if (len[x] % 2 == 0) {
//                    times[x] = dp[pos - len[x]];
//                }
//                times[x] = addv(times[x], times[fail[x]]);
////                cout << times[x] << " 11 "<< times[fail[x]] << " " << x << " "<<fail[x]<< endl;
//              } else {
//                  if (len[x] % 2 == 0)
//                    times[x] = dp[pos - len[x]];
//              }
//              if (pos % 2 == 0){
//                dp[pos] += times[x];
////                cout << dp[pos] << " debug " << pos << " " << times[x] << " " << (x != y) << " " <<len[x] << " " <<len[y]<<endl;
//              }
                if (len[x] % 2 == 0)
                dp[pos] = addv(dp[pos], dp[pos-len[x]]);
              /*
              长度为len[y]~len[x]的后缀都是回文后缀
              能够组成最多log个等差数列的形式,按照结构体的形式存储
              len[y]是起始长度, len[x]是最后一个位置的长度，diff[x]是公差，(len[x]-len[y])/diff[x]+1是数列长度
              */
              //printf("! %d %d %d %d\n",len[y],len[x],diff[x],(len[x]-len[y])/diff[x]);
              x=fail[x];
            }
          }
        } suf;
        void build(string str) {
//            cout <<str << endl;
            suf.init();
            dp[0] = 1;
            for (int i = 0; i < str.size(); i++) {
                suf.add(str[i], i + 1);
                int ca;
                suf.get(i+1, ca);
            }
            printf("%lld\n", dp[str.size()]);
        }
    };

    void solve() {
        string s1, s2;
        cin >> s1;
        s2 = s1;
        reverse(all(s2));
        string ss;
        for (int i = 0; i < s1.size()/2; i++) {
            ss += s1[i];
            ss += s2[i];
        }
//        cout << ss <<endl;
        ds::build(ss);
    }
};

int main() {
#ifdef iostart
    ios::sync_with_stdio(0);
    cin.tie(0);
#endif // iostart
//    file();
    solver::solve();
    return 0;
}

/*
4 3
1 2 10
2 3 4
3 4 1
2
1 4
*/


#include <bits/stdc++.h>
using namespace std;

#ifndef HOME
const int SIGMA = 26;
const int DIM = 1e6 + 5;
const int MOD = 1e9 + 7;
#else
const int SIGMA = 26;
const int DIM = 20;
const int MOD = 1e9 + 7;
#endif

char str[DIM], aux[DIM];
int nxt[DIM][SIGMA], sans[DIM], ans[DIM];
int link[DIM], len[DIM], diff[DIM], slink[DIM];

inline void _(int &a, int b) {
	a += b;
	if (a >= MOD)
		a -= MOD;
}

int nr, sz, last;
void init(void) {
	nr = 1;
	len[1] = -1;
	str[0] = -1;
	link[0] = 1;
}

int getSuff(int v) {
	while (str[sz] != str[sz - len[v] - 1])
		v = link[v];
	return v;
}

void add(int p) {
	int c = (str[p] -= 'a'); sz++;
	last = getSuff(last);
	if (!nxt[last][c]) {
		++nr;
		len[nr] = len[last] + 2;
		link[nr] = nxt[getSuff(link[last])][c];
		diff[nr] = len[nr] - len[link[nr]];
		slink[nr] = link[nr];
		if (diff[nr] == diff[link[nr]])
			slink[nr] = slink[link[nr]];
		nxt[last][c] = nr;
	}
	last = nxt[last][c];
}

int main(void) {
#ifdef HOME
	freopen("g.in", "r", stdin);
	freopen("g.out", "w", stdout);
#endif
	cin >> (aux + 1);
	int n = strlen(aux + 1);
	for (int i = 1, j = n, m = 0; i <= j; ++i, --j) {
		str[++m] = aux[i];
		if (i != j)
			str[++m] = aux[j];
	}
	ans[0] = 1;
	init();
	for (int i = 1; i <= n; ++i) {
		add(i);
		for (int v = last; len[v] > 0; v = slink[v]) {
			sans[v] = ans[i - (len[slink[v]] + diff[v])];
			if (diff[v] == diff[link[v]])
				_(sans[v], sans[link[v]]);
			_(ans[i], sans[v]);
		}
		if (i & 1)
			ans[i] = 0;
	}
	cout << ans[n] << endl;
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define FIR first
#define SEC second
#define ll long long
using namespace std;
template <class T>
inline void rd(T &x) {
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)) { if(c=='-') f=-1; c=getchar(); }
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}

const int mod=1e9+7;
const int N=1e6+10;
int link[N],slink[N],diff[N],len[N],last;
namespace PT {
	int ch[N][26],ncnt;
	int S[N],n;
	void init() {
		ncnt=1;
		link[0]=1,link[1]=0;
		len[0]=0,len[1]=-1;
	}
	void ins(int c) {
		S[++n]=c;
		int p=last; while(S[n-len[p]-1]!=S[n]) p=link[p];
		if(!ch[p][c]) {
			int q=++ncnt,u=link[p]; while(S[n-len[u]-1]!=S[n]) u=link[u];
			link[q]=ch[u][c],ch[p][c]=q;
//			cout<<"add : "<<q<<' '<<p<<' '<<link[q]<<endl;
			len[q]=len[p]+2,diff[q]=len[q]-len[link[q]],slink[q]=diff[q]==diff[link[q]] ? slink[link[q]] : link[q];
		}
		last=ch[p][c];
	}
}
int dp[N],g[N];
int n;
char S[N],T[N];
int main() {
	scanf("%s",S+1); n=strlen(S+1);
	for(int i=1,tp=0;i<n-i+1;++i)
		T[++tp]=S[i],
		T[++tp]=S[n-i+1];
	PT::init();
	dp[0]=1;
	for(int i=1;i<=n;++i) {
		PT::ins(T[i]-'a');
		for(int u=last;len[u]>0;u=slink[u]) {
			g[u]=dp[i-len[slink[u]]-diff[u]];
			if(slink[u]!=link[u]) g[u]=(g[u]+g[link[u]])%mod;
			if(!(i&1)) dp[i]=(dp[i]+g[u])%mod;
		}
//		cout<<"dp["<<i<<"] = "<<dp[i]<<endl;
	}
	printf("%d",dp[n]);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define FIR first
#define SEC second
#define ll long long
using namespace std;
template <class T>
inline void rd(T &x) {
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)) { if(c=='-') f=-1; c=getchar(); }
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}

const int mod=1e9+7;
const int N=1e6+10;
int link[N],slink[N],diff[N],len[N],last;
namespace PT {
	int ch[N][26],ncnt;
	int S[N],n;
	void init() {
		ncnt=1;
		link[0]=1,link[1]=0;
		len[0]=0,len[1]=-1;
		S[0]=-1;
	}
	void ins(int c) {
		S[++n]=c;
		int p=last; while(S[n-len[p]-1]!=S[n]) p=link[p];
		if(!ch[p][c]) {
			int q=++ncnt,u=link[p]; while(S[n-len[u]-1]!=S[n]) u=link[u];
			link[q]=ch[u][c],ch[p][c]=q;
//			cout<<"add : "<<q<<' '<<p<<' '<<link[q]<<endl;
			len[q]=len[p]+2,diff[q]=len[q]-len[link[q]],slink[q]=diff[q]==diff[link[q]] ? slink[link[q]] : link[q];
		}
		last=ch[p][c];
	}
}
int dp[N],g[N];
int n;
char S[N],T[N];
int main() {
	scanf("%s",S+1); n=strlen(S+1);
	for(int i=1,tp=0;i<n-i+1;++i)
		T[++tp]=S[i],
		T[++tp]=S[n-i+1];
	for(int i=1;i<=n;++i) cout<<T[i]; cout<<endl;
	PT::init();
	dp[0]=1;
	for(int i=1;i<=n;++i) {
		PT::ins(T[i]-'a');
		for(int u=last;len[u]>0;u=slink[u]) {
			g[u]=dp[i-len[slink[u]]-diff[u]];
			if(slink[u]!=link[u]) g[u]=(g[u]+g[link[u]])%mod;
			if(!(i&1)) dp[i]=(dp[i]+g[u])%mod;
		}
//		cout<<"dp["<<i<<"] = "<<dp[i]<<endl;
	}
	printf("%d",dp[n]);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#define ll long long
using namespace std;
template <class T>
inline void read(T &x)
{
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)){if(c=='-')f=-1; c=getchar();}
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}
const int N=1e6+10,mod=1e9+7;
int ch[N][26],fail[N],len[N],diff[N],last;
int fa[N];
struct Palindromic_Tree{
	char S[N];
	int ncnt,n;
	void init()
	{
		n=0; S[0]=-1;
		ncnt=last=1;
		fail[1]=0,fail[0]=1,len[0]=0,len[1]=-1;
	}
	int get(int u){ while(S[n-len[u]-1]!=S[n]) u=fail[u]; return u;}
	void insert(int c)
	{
		S[++n]=c; int cur=get(last);
		if(!ch[cur][c])
		{
			int now=++ncnt; len[now]=len[cur]+2;
			fail[now]=ch[get(fail[cur])][c],ch[cur][c]=now;

			diff[now]=len[now]-len[fail[now]];
			fa[now]=(diff[now]==diff[fail[now]])?fa[fail[now]]:fail[now];

		}
		last=ch[cur][c];
	}
}PT;
char str[N],s1[N];
int n;
int f[N],g[N];
int main()
{
	scanf("%s",s1+1); n=strlen(s1+1);
	if(n&1){puts("0"); return 0;}
	for(int i=1,l=0;i*2<=n;++i) str[++l]=s1[i],str[++l]=s1[n-i+1];
//	for(int i=1;i<=n;++i) printf("%c",str[i]); puts("");
	f[0]=1; PT.init();
	for(int i=1;i<=n;++i)
	{
		PT.insert(str[i]-'a');
//		printf("%d: ",i);
		for(int v=last;v;v=fa[v])
		{
//			printf("%d --- ",i-len[fa[v]]-diff[v]);
			g[v]=f[i-len[fa[v]]-diff[v]];
			if(diff[v]==diff[fail[v]]) g[v]=(g[v]+g[fail[v]])%mod;
			if(!(i&1)) f[i]=(f[i]+g[v])%mod;
		}
//		printf("%d\n",f[i]);
	}
	printf("%d",f[n]);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define FIR first
#define SEC second
#define ll long long
using namespace std;
template <class T>
inline void rd(T &x) {
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)) { if(c=='-') f=-1; c=getchar(); }
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}

const int mod=1e9+7;
const int N=1e6+10;
int link[N],slink[N],diff[N],len[N],last;
namespace PT {
	int ch[N][26],ncnt;
	int S[N],n;
	void init() {
		ncnt=1;
		link[0]=1,link[1]=0;
		len[0]=0,len[1]=-1;
		S[0]=-1;
	}
	void ins(int c) {
		S[++n]=c;
		int p=last; while(S[n-len[p]-1]!=S[n]) p=link[p];
		if(!ch[p][c]) {
			int q=++ncnt,u=link[p]; while(S[n-len[u]-1]!=S[n]) u=link[u];
			link[q]=ch[u][c],ch[p][c]=q;
//			cout<<"add : "<<q<<' '<<p<<' '<<link[q]<<endl;
			len[q]=len[p]+2,diff[q]=len[q]-len[link[q]],slink[q]=diff[q]==diff[link[q]] ? slink[link[q]] : link[q];
		}
		last=ch[p][c];
	}
}
int dp[N],g[N];
int n;
char S[N],T[N];
int main() {
	scanf("%s",S+1); n=strlen(S+1);
	for(int i=1,tp=0;i<n-i+1;++i)
		T[++tp]=S[i],
		T[++tp]=S[n-i+1];
//	for(int i=1;i<=n;++i) cout<<T[i]; cout<<endl;
	PT::init();
	dp[0]=1;
	for(int i=1;i<=n;++i) {
		PT::ins(T[i]-'a');
		for(int u=last;len[u]>0;u=slink[u]) {
			g[u]=dp[i-len[slink[u]]-diff[u]];
			if(slink[u]!=link[u]) g[u]=(g[u]+g[link[u]])%mod;
			if(!(i&1)) dp[i]=(dp[i]+g[u])%mod;
		}
//		cout<<"dp["<<i<<"] = "<<dp[i]<<endl;
	}
	printf("%d",dp[n]);
	return 0;
}


#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <iomanip>
#include <bitset>
#include <bits/stdc++.h>

using namespace std;

const int N=1e6+10;
const int mod = 1e9 + 7;
char s[N],t[N],S[N];
int n,go[N][26],len[N],par[N],top,last;
int New(int L){len[++top]=L;return top;}
int diff[N],slink[N];
void extend(int n){
	int w=S[n],p=last;
	while (S[n-len[p]-1]!=w) p=par[p];
	if (!go[p][w-'a']){
		int q=New(len[p]+2),now=p;
		do now=par[now];while (S[n-len[now]-1]!=w);
		par[q]=go[now][w-'a'];
		go[p][w-'a']=q;
		diff[q]=len[q]-len[par[q]];
		slink[q]=(diff[q]==diff[par[q]]?slink[par[q]]:par[q]);
	}
	last=go[p][w-'a'];
}
int ans[N],from[N],_ans[N], sum[N];
char kek[N];
int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
#endif
    scanf("%s", kek + 1);
    int n = strlen(kek + 1);
    for (int i = 1; i <= n / 2; i++) s[i] = kek[i];
    for (int i = 1; i <= n / 2; i++) t[i] = kek[n - i + 1];
	n /= 2;
	for (int i=1;i<=n;i++) S[i*2-1]=s[i],S[i*2]=t[i];
	par[0]=top=1;len[1]=-1;
	n*=2;
	for (int i=1;i<=n;i++) ans[i]=0;
	_ans[0]= 1;
    ans[0] = 1;
	for (int i=1;i<=n;i++){
		extend(i);
		for (int p=last;p;p=slink[p]){
			_ans[p]=i-(len[slink[p]]+diff[p]);
            sum[p] = ans[_ans[p]];
            int cur = p;
            if (diff[par[cur]]==diff[cur])
            {
                sum[cur] += sum[par[cur]];
                if (sum[cur] >= mod) sum[cur] -= mod;
            }
            if (!(i & 1))
            {
                ans[i] += sum[cur];
                if (ans[i] >= mod) ans[i] -= mod;
            }

		}
	}
    cout << ans[n] << '\n';
}


#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <iomanip>
#include <bitset>

using namespace std;

const int N=1e6+10;
const int mod = 1e9 + 7;
char s[N],t[N],S[N];
int n,go[N][26],len[N],par[N],top,last;
int New(int L){len[++top]=L;return top;}
int diff[N],slink[N];
void extend(int n){
	int w=S[n],p=last;
	while (S[n-len[p]-1]!=w) p=par[p];
	if (!go[p][w-'a']){
		int q=New(len[p]+2),now=p;
		do now=par[now];while (S[n-len[now]-1]!=w);
		par[q]=go[now][w-'a'];
		go[p][w-'a']=q;
		diff[q]=len[q]-len[par[q]];
		slink[q]=(diff[q]==diff[par[q]]?slink[par[q]]:par[q]);
	}
	last=go[p][w-'a'];
}
int ans[N],from[N],_ans[N], sum[N];
char kek[N];
int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
#endif
    scanf("%s", kek + 1);
    int n = strlen(kek + 1);
    for (int i = 1; i <= n / 2; i++) s[i] = kek[i];
    for (int i = 1; i <= n / 2; i++) t[i] = kek[n - i + 1];
	n /= 2;
	for (int i=1;i<=n;i++) S[i*2-1]=s[i],S[i*2]=t[i];
	par[0]=top=1;len[1]=-1;
	n*=2;
	for (int i=1;i<=n;i++) ans[i]=0;
	_ans[0]= 1;
    ans[0] = 1;
	for (int i=1;i<=n;i++){
		extend(i);
		for (int p=last;p;p=slink[p]){
			_ans[p]=i-(len[slink[p]]+diff[p]);
            sum[p] = ans[_ans[p]];
            int cur = p;
            if (diff[par[cur]]==diff[cur])
            {
                sum[cur] += sum[par[cur]];
                if (sum[cur] >= mod) sum[cur] -= mod;
            }
            if (!(i & 1))
            {
                ans[i] += sum[cur];
                if (ans[i] >= mod) ans[i] -= mod;
            }

		}
	}
    cout << ans[n] << '\n';
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define MAX 1000005
#define MAXN 1000005
using namespace std;
typedef long long ll;
struct Palindrome_Automaton
{
	int tot,lst,len[MAX],ch[26][MAX],f[MAX],cnt=0;
	int anc[MAX],diff[MAX],g[MAX],dp[MAX];
	const int mod=998244353;
	char s[MAX];
	int M(int x){return x>=mod?x-mod:x;}
	int newnode(int v)
	{
		int i;
		tot++;
		len[tot]=v;
		for(i=0;i<26;i++)ch[i][tot]=0;
		return tot;
	}
	void init()
	{
		int i;
		tot=1;lst=0;
		len[0]=0;len[1]=-1;f[0]=1;
		diff[0]=diff[1]=-1;dp[0]=1;//这里初始化dp,别忘初始化f
		for(i=0;i<26;i++)ch[i][0]=ch[i][1]=0;
	}
	int getfail(int p,int pos)
	{
		while(pos-len[p]-1<0||s[pos-len[p]-1]!=s[pos])p=f[p];
		return p;
	}
	void ins(int pos)
	{
		int ty;
		lst=getfail(lst,pos);
		ty=s[pos]-'a';
		if(ch[ty][lst]==0)
		{
			ch[ty][lst]=newnode(len[lst]+2);
			if(lst==1)f[tot]=0;
			else f[tot]=ch[ty][getfail(f[lst],pos)];
			diff[tot]=len[tot]-len[f[tot]];
			anc[tot]=(diff[f[tot]]==diff[tot])?anc[f[tot]]:f[tot];
		}
		lst=ch[ty][lst];
	}
	void trans(int p)//这里需要自己写
	{
		int i;
		for(i=lst;i>1;i=anc[i])
		{
			g[i]=dp[p-len[anc[i]]-diff[i]];
			if(anc[i]!=f[i])g[i]=M(g[i]+g[f[i]]);
			if(p%2==0)dp[p]=M(dp[p]+g[i]);
		}
	}
	void build(int n){int i;for(i=0;i<n;i++)ins(i),trans(i+1);}
}pam;
int n,t,_,i,pre,tot=0,ans=0;
char s[1000005];
int main()
{
	pam.init();
	scanf("%s",s);
	n=strlen(s);
	for(i=0;i<n/2;i++)pam.s[2*i]=s[i];
	for(i=n-1;i>=n/2;i--)pam.s[1+2*(n-1-i)]=s[i];
	pam.build(n);
	printf("%d\n",pam.dp[n]);
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define MAX 1000005
#define MAXN 1000005
using namespace std;
typedef long long ll;
struct Palindrome_Automaton
{
	int tot,lst,len[MAX],ch[26][MAX],f[MAX],cnt=0;
	int anc[MAX],diff[MAX],g[MAX],dp[MAX];
	const int mod=1e9+7;
	char s[MAX];
	int M(int x){return x>=mod?x-mod:x;}
	int newnode(int v)
	{
		int i;
		tot++;
		len[tot]=v;
		for(i=0;i<26;i++)ch[i][tot]=0;
		return tot;
	}
	void init()
	{
		int i;
		tot=1;lst=0;
		len[0]=0;len[1]=-1;f[0]=1;
		diff[0]=diff[1]=-1;dp[0]=1;//这里初始化dp,别忘初始化f
		for(i=0;i<26;i++)ch[i][0]=ch[i][1]=0;
	}
	int getfail(int p,int pos)
	{
		while(pos-len[p]-1<0||s[pos-len[p]-1]!=s[pos])p=f[p];
		return p;
	}
	void ins(int pos)
	{
		int ty;
		lst=getfail(lst,pos);
		ty=s[pos]-'a';
		if(ch[ty][lst]==0)
		{
			ch[ty][lst]=newnode(len[lst]+2);
			if(lst==1)f[tot]=0;
			else f[tot]=ch[ty][getfail(f[lst],pos)];
			diff[tot]=len[tot]-len[f[tot]];
			anc[tot]=(diff[f[tot]]==diff[tot])?anc[f[tot]]:f[tot];
		}
		lst=ch[ty][lst];
	}
	void trans(int p)//这里需要自己写
	{
		int i;
		for(i=lst;i>1;i=anc[i])
		{
			g[i]=dp[p-len[anc[i]]-diff[i]];
			if(anc[i]!=f[i])g[i]=M(g[i]+g[f[i]]);
			if(p%2==0)dp[p]=M(dp[p]+g[i]);
		}
	}
	void build(int n){int i;for(i=0;i<n;i++)ins(i),trans(i+1);}
}pam;
int n,t,_,i,pre,tot=0,ans=0;
char s[1000005];
int main()
{
	pam.init();
	scanf("%s",s);
	n=strlen(s);
	for(i=0;i<n/2;i++)pam.s[2*i]=s[i];
	for(i=n-1;i>=n/2;i--)pam.s[1+2*(n-1-i)]=s[i];
	pam.build(n);
	printf("%d\n",pam.dp[n]);
	return 0;
}


#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

const int SIGMA = 26;

struct palindromic_tree {
  struct node;
  using iter = vector<node>::iterator;

  struct node {
    iter child[SIGMA], fail, nxt;
    int len, diff, g;
  };

  iter head, tail;
  vector<node> pool;
  iter last;
  int len;
  vector<int> a;

  iter new_node(int len) {
    iter p = last++;
    p->len = len;
    // p->cnt = 0;
    fill(p->child, p->child + SIGMA, pool.begin());
    p->fail = pool.begin();
    return p;
  }

  void init(int n) {
    pool.resize(n + 2);
    last = pool.begin();
    a.resize(n + 1);
    head = new_node(0);
    head->fail = new_node(-1);
    tail = head;
    len = 0;
    a[len] = -1;
  }

  iter get_fail(iter p) {
    while (a[len - p->len - 1] != a[len]) p = p->fail;
    return p;
  }

  void add(int c) {
    a[++len] = c;
    iter p = get_fail(tail);
    if (p->child[c] == head) {
      iter q = new_node(p->len + 2);
      iter r = q->fail = get_fail(p->fail)->child[c];
      p->child[c] = q;
      q->diff = q->len - r->len;
      q->nxt = q->diff == r->diff ? r->nxt : r;
    }
    tail = p->child[c];
  }

  // void pushup_count() {
  //   for (iter p = last - 1; p != head + 1; --p) {
  //     p->fail->cnt += p->cnt;
  //   }
  // }
};

const int N = 1e6 + 10;
char s[N], t[N];

void add(int& x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}

int main() {
  scanf("%s", t);
  int n = strlen(t);
  for (int i = 0; i < n / 2; ++i) {
    s[i * 2] = t[i];
    s[i * 2 + 1] = t[n - 1 - i];
  }
  // puts(s);
  palindromic_tree pt;
  pt.init(n);
  vector<int> dp(n + 1);
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    pt.add(s[i] - 'a');
    for (auto p = pt.tail; p > pt.head + 1; p = p->nxt) {
      // trace(i, p - pt.pool.begin(), p->len, p->diff, p->nxt->len);
      p->g = dp[i + 1 - p->nxt->len - p->diff];
      if (p->diff == p->fail->diff) add(p->g, p->fail->g);
      if ((i + 1) % 2 == 0) add(dp[i + 1], p->g);
    }
    // trace(i, dp[i + 1]);
  }
  printf("%d\n", dp[n]);
  return 0;
}


#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

const int N = 1e6 + 10;
char s[N];
int f[N], dp[N], sum[N];
vector<int> a[N];

int main() {
  scanf("%s", s);
  int n = strlen(s);
  assert(n % 2 == 0);
  int m = n / 2;
  m = n;
  f[0] = 0;
	int k = 0;
	for (int i = 1; i < m; ++i) {
		for (; k > 0 && s[k] != s[i]; k = f[k - 1]);
		if (s[k] == s[i]) k++;
		f[i] = k;
	}
  for (int i = 0; i < n; ++i) {
    trace(i, f[i]);
  }
  // for (int i = 0; i < m; ++i) {
  //   --f[i];
  //   a[f[i]].push_back(i);
  // }
  // sum[m] = dp[m] = 1;
  // for (int i = m - 1; i >= 0; --i) {

  // }
  return 0;
}