a[51],j,s,y,c;main(i){for(;~scanf("%d",a+i);s=1)i+=s;for(;y=--i;s+=~c%2)for(c=1;(y=a[y])&&y-i;c++);s=!puts(s%2?"Yes":"No");}