const MOD: usize = 1e9 as usize + 7; fn dfs(s: &str, dp: &mut Vec>) -> usize { let n = s.len(); if dp[n].is_some() { return dp[n].unwrap(); } let mut ret = 1usize; for i in 1..=n/2 { if s[..i] == s[n-i..] { ret += dfs(&s[i..n-i], dp); ret %= MOD; } } dp[n] = Some(ret); ret } fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim(); let mut dp = vec![None; s.len()+1]; dp[0] = Some(1); println!("{}", dfs(s, &mut dp)); }