import sys sys.setrecursionlimit(10000) S = input() num = 1 nums = {} def get_n(s): global num if nums.get(s): num += nums[s] return start_num = num for idx in range(len(s)): if len(s) <= 1 or idx + 1 > len(s) // 2: nums[s] = num - start_num return if s[idx] == s[len(s) - 1]: if s[:idx + 1] == s[len(s) - idx - 1:]: num += 1 get_n(s[idx + 1:len(s) - idx - 1]) get_n(S) print(num % 1000000007)