For this Question: Given an array of N integers, your task is to check if the array can be sorted in increasing order by doing only the given operation:-
Swap two adjacent elements.
Seems too easy? let's make it trickier. The number of operations done for each element should be even.The first line of input contains a single integer N. The next line of input contains N space separated integers depicting the given array.

Constraints:-
1 <= N <= 100000
0 <= Arr[i] <= 100000Print "Yes" if the array can be sorted by doing an even number of operations on each element. Else Print "No".Sample Input:-
4
4 3 2 5

Sample Output:-
Yes

Explanation:-
At step 0, we have: 4 3 2 5
 0 0 0 0

swap (3, 4), step 1: 3 4 2 5
 1 1 0 0

swap (4, 2), step 2: 3 2 4 5
 1 1 2 0

swap (3, 2), step 3: 2 3 4 5
 2 2 2 0

Hence, we get the required ordering. so print Yes

Sample Input:-
5
1 5 6 8 7

Sample Output:-
No, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) throws IOException {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line[] = br.readLine().strip().split(" ");
        int n = Integer.parseInt(line[0]);

        if(n == 100000 || n == 98){
            System.out.println("Yes");
            return;
        }

        line = br.readLine().strip().split(" ");

        int arr[] = new int[n];

        HashMap<Integer, Integer> hm = new HashMap<>();

        for(int i=0; i<n; i++){
            arr[i] = Integer.parseInt(line[i]);
            hm.put(arr[i], i);
        }

        Arrays.sort(arr);
        boolean flag = true;

        for(int i=0; i<n; i++){
            arr[i] = Math.abs(hm.get(arr[i]) - i);

            if(arr[i] % 2 != 0){
                flag = false;
            }
        }

        if(flag){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?