import sys sys.setrecursionlimit(10**7) 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)-96 for s in S] mod = 10**9+7 r = 1234 H = [[0]*N for _ in range(N)] # H[i][j] = S[i:j+1]のRolling Hash for i in range(N): h = 0 for j in range(i,N): h *= r h += ord_S[j] h %= mod H[i][j] = h 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 H[i][j] == H[N-1-j][N-1-i]: x += dp[j+1] x %= mod dp[i] = x ans = dp[0] print(ans)