chars = gets.chomp.chars puts chars[0..chars.length / 2 - 1] == chars[chars.length / 2 .. chars.length - 1] ? "YES" : "NO"