#include using namespace std; #define rep(i,n) for(int (i) = 0 ; (i) < (int)(n) ; (i)++) #define REP(i,a,b) for(int (i) = a ; (int)(i) <= (int)(b) ; (i)++) #define all(n) (n).begin(),(n).end() int main(){ int n; cin >> n; vector a(n); int c = 0; rep(i,n) cin >> a[i]; rep(i,n) rep(j,n-i-1) if( a[j] > a[j+1] ) swap(a[j],a[j+1]),c++; cout << (c%2?"No":"Yes") << endl; }