abc = gets length = abc.length/2 bbb = abc.scan(/.{1,#{length}}/) if bbb[0] == bbb[1] puts "Yes" else puts "No" end