import sys,collections mod = 10**9+7 sys.setrecursionlimit(mod) s= input() d = collections.defaultdict(lambda: 1) def DFS(s): if s in d: return d[s] rh1,rh2 = 0,0 for i in range(1,len(s)//2+1): rh1 = rh1 + ord(s[i-1])*(2**i) rh2 = rh2 + ord(s[-i])*(2**i) if rh1 == rh2 and s[:i] == s[-i:]: d[s] += DFS(s[i:-i]) return d[s] print(DFS(s)%mod)