import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static long dfs(int offset, char[] ins, long[] memo){ if(memo[offset] >= 0){ return memo[offset]; } long ret = 1; LOOP: for(int len = 1; ;len++){ final int fst_begin = offset; final int snd_end = ins.length - offset; final int snd_begin = snd_end - len; final int fst_end = fst_begin + len; if(fst_end >= snd_begin){ break; } /* System.out.println(fst_begin + " " + snd_begin + " " + len); System.out.println("[" + fst_begin + ", " + fst_end + "]"); //*/ for(int i = 0; i < len; i++){ final int fst = fst_begin + i; final int snd = snd_begin + i; if(ins[fst] != ins[snd]){ continue LOOP; } } //System.out.println(offset + " " + fst_begin + " " + snd_begin + " " + len); ret += dfs(offset + len, ins, memo); ret %= MOD; } return memo[offset] = ret; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); final char[] ins = sc.next().toCharArray(); long[] memo = new long[ins.length]; Arrays.fill(memo, -1); System.out.println(dfs(0, ins, memo)); } }