A string is a butterfly string if it has a 0 at the middle of the string and at both sides of 0 there are exactly the same number of positive length of characters and all the characters are same. For a given string of size, n determine if it is a butterfly string or not.
Input starts with n the size of the string and at the second line, there will be a string of size n consisting of uppercase English letters, lowercase English letters, and digits.
1 ≤ n ≤ 100
If the given string is a butterfly string print “YES” else “NO” ( without quotation signs ) in a single line
Input | Output |
---|---|
5 YY0YY | YES |