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