using System; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); string s = Console.ReadLine(); int maxW = n / 2; for (int w = 1; w <= maxW; w++) { int tmp = n - 2 * w; for (int i = 0; i <= tmp; i++) { if (s.Substring(i, w) == s.Substring(i + w, w)) { Console.WriteLine("YES"); return; } } } Console.WriteLine("NO"); } }