from functools import lru_cache import sys sys.setrecursionlimit(1000000) @lru_cache(maxsize=None) def is_kaibun (S): global memo l = len(S) left_index = 1 right_index = l-1 count = 1 if S in memo: return memo[S] while left_index-1 < right_index: if S[0:left_index] == S[right_index:]: count += is_kaibun(S[left_index:right_index]) left_index += 1 right_index -= 1 memo[S] = count return count if __name__ == "__main__": S = input() l = len(S) memo = {} ans = is_kaibun(S) % 1000000007 print(ans)