import sys sys.setrecursionlimit(10**6) S = [ord(c) for c in input()] #S = [ord("a")]*(10**4) length = len(S) mod = 10**9+7 left_kc, right_kc = S[:length//2], S[::-1][:length//2] S = None p = 1 for i in range(length//2): left_kc[i] = (left_kc[i] * p) % mod p = p * 10 % mod dp = [0]*(length//2+1) def rec(left): count = 1 left_hash, right_hash = 0, 0 m = pow(10, left, mod) for i, (lc, rc) in enumerate(zip(left_kc[left:length//2], right_kc[left:length//2]), start=left): left_hash = (left_hash + lc) % mod right_hash = (right_hash * 10 + rc*m) % mod if left_hash == right_hash: count += dp[i+1] or rec(i+1) count %= mod dp[left] = count % mod return dp[left] print(rec(0))