($h,$w)=<>=~/\d+/g; $/=\1; for$y(0..$h-1){ for$x(0..$w-1){ $a[$x|$y<<8]=<>; } die if <> ne "\n"; } for$v(0..$h-1){ for$u(1-$w..$w-1){ if($v+$u){ hoge1:{ @b=@a; for$y(0..$h-1){ for$x(0..$w-1){ if($b[$x|$y<<8] eq '#'){ if($x+$u>=0 && $b[$x+$u|$y+$v<<8] eq '#'){ $b[$x+$u|$y+$v<<8]=0; }else{ last hoge1; } } } } print 'YES'; exit; } } } } print 'NO';