sub f{$a[$x=$z+"@_"]-$z-1or$a[$z]=$z+1,$z=$x} $/=a;@a=<>=~/\d+/g; ($z)=grep{!$a[$_]}0..15; $z>3&&f(-4),$z<12&&f(4),$z%4&&f(-1),$z%4<3&&f(1)for 0..15; $a[$z]=16; print grep($a[$_]-$_-1,0..15)?No:Yes