For this Question: Bob was working on a new algorithm to make an array non-decreasing. he came up with the following algorithm :

For an array a of size n
Step 1: Select two indexes i and j, 0 &le; i &lt j &lt n.
Step 2: if a[i] + a[j] is odd then do a[i] = a[j]
 if a[i] + a[j] is even then do a[j] = a[i] 
Step 3: Repeat steps 1 and 2 until the array is non-decreasing.

Bob is not sure about his algorithm, he asks you if it is possible to make the given array non-decreasing using the mentioned algorithm.The first line contains n.
The next line contains n space-separated integers.

<b>Constraints</b>
1 &le; n &le; 10<sup>5</sup>
1 &le; a[i] &le; 10<sup>9</sup>Print "YES" of it is possible to make array non- decreasing, otherwise print "NO".Input:
4
3 2 5 3

Output:
YES

Explanation:
(i, j) => (0, 1) => 3+2 = 5 => odd => a[0] = a[1] => a[0] = 2
(i, j) => (2, 3) => 5+3 = 8 => even=> a[3]= a[2] => a[3] = 5
final aray => 2 2 5 5, I have written this Solution Code: import java.io.*;
import java.util.*;




public class Main {

    
    public static void main(String[] args) {
        
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        
        int n=Integer.parseInt(in.next());
       
        Integer a[] = new Integer[n];
        for(int t=0;t<n;t++){
            a[t] = Integer.parseInt(in.next());
        }
         
        out.print("YES");
        out.close();
    }

    
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?