Scanf.scanf "%s" (fun s -> let n = String.length s in let rec check r i j = if r = 0 then true else if s.[i] = s.[j] then check (r - 1) (i + 1) (j + 1) else false in print_endline @@ if n mod 2 = 0 && check (n / 2) 0 (n / 2) then "YES" else "NO" )