n=gets.to_i;f=[nil]*n;a=gets.split.map{|e|e.to_i-1};b=n.times.map{|i|if f[i] then -1 else x=a[i];c=1;while x!=i do f[x]=1;x=a[x];c+=1;end;c;end};puts [:Yes,:No][b.count{|e|e%2==0}%2]