import sys def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) S = S() N = len(S) if N % 2 == 1: S = S[:N//2]+S[N//2+1:] N -= 1 ord_S = [ord(s) for s in S] mod = 10**9+7 r = 1234 A = [ord_S[0]] for i in range(1,N): A.append((A[-1]*r+ord_S[i]) % mod) power_r = [1] for _ in range(N): power_r.append((power_r[-1]*r) % mod) def RH(i,j): # S[i:j+1]のローリングハッシュ if i == 0: return A[j] else: return (A[j]-A[i-1]*power_r[j-i+1]) % mod dp = [0]*(N//2+1) # dp[i] = S[i:N-i]に対する答え dp[-1] = 1 for i in range(N//2-1,-1,-1): x = 1 for j in range(i,N//2): if RH(i,j) == RH(N-1-j,N-1-i): x += dp[j+1] x %= mod dp[i] = x ans = dp[0] print(ans)