#include using namespace std; typedef long long ll; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) const int MOD = 1000000007; int N, a[51], b[51]; bool done[51]; int loop_size(int i){ if(done[i]) return 0; done[i] = true; return loop_size(a[i]) + 1; } int main(){ cin >> N; REP(i,N){ cin >> a[i]; a[i]--; b[i] = -1; } int k = 0; REP(i,N){ if(done[i]) continue; if(loop_size(i)%2 == 0) k ^= 1; } cout << (k?"No":"Yes") << endl; return 0; }