Under construction

Still being built. Things may change

Palindrome Anagram

Interview

Time limit1sMemory limit1024 MB

Summary
Decide whether swaps between the left and right halves can turn a string into a palindrome, given that the middle character stays fixed for odd N.
Level

Easy3 of 10

Topics
String, Hash map
Solved
No attempts yet

Problem

A palindrome is a string that reads the same forwards and backwards. For example, radar is a palindrome, but konkuk is not. You are given a string SS of length NN made only of lowercase English letters. Can you make SS a palindrome by performing the following operation zero or more times? Pick one of the first ⌊N2⌋\left\lfloor \frac{N}{2} \right\rfloor characters on the left and one of the last ⌊N2⌋\left\lfloor \frac{N}{2} \right\rfloor characters on the right, then swap their positions.

Input

The first line contains an integer NN, the length of the string. (3≤N≤200,000)\left( 3\leq N\leq 200\\, 000 \right) The second line contains the string SS of length NN, made only of lowercase English letters.

Output

If SS can be made a palindrome with zero or more operations, print Yes. Otherwise, print No.

Hint

⌊x⌋\lfloor x\rfloor is xx rounded down to the nearest integer. For example, ⌊2.5⌋\lfloor 2.5\rfloor is 22.

Examples2

  1. Example 1

    Input
    11
    abracadabra
    
    Expected output
    No
    
  2. Example 2

    Input
    11
    abracacabra
    
    Expected output
    Yes