For this Question: You are given an array A of size N. In one move, you can swap A<sub>i</sub> and A<sub>i+1</sub> if A<sub>i</sub> + A<sub>i+1</sub> is odd. Find out if you can sort this array non- decreasingly after performing any (possibly 0) number of moves.The first line of the input contains a single integer N.
The second line of the input contains N space separated integers.

<b>Constraints:</b>
1 <= N <= 10<sup>5</sup>
1 <= A<sub>i</sub> <= 10<sup>9</sup>Print "YES" if you can sort the array non- decreasingly, else print "NO", without the quotes.Sample Input:
4
1 6 31 14

Sample Output:
YES, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(),(x).end()

signed main(){
    int n;
    cin>>n;
assert(1 <= n <= (int)1e5);
    vector<int> a[2];
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
assert(1 <= x <= (int)1e9);
        a[x&1].push_back(x);
    }
    if (is_sorted(all(a[0])) && is_sorted(all(a[1]))) cout<<"YES"; 
    else cout<<"NO";
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?