Longest Palindrome Substring
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

    A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. For example, ”a”、”aba”、“abba” are palindrome and “abc”、”aabb” are not.

    Let’s define a new function f(s).

    For some string s, f(s) is the length of the longest palindrome substring.

    Now you should decide for the given string s, whether f(s) is great than 1.
    The string s only contains lowercase letters.

输入描述:

The first line of the input contains one integer n ------ the length of the string (1<=n<=10^5)

The second line of the input is the string.

输出描述:

If f(s) great than 1, print “YES” without quote

Else print “NO” without quote
示例1

输入

复制
4
abcd

输出

复制
NO
示例2

输入

复制
4
abcb

输出

复制
YES