module maze
integer,allocatable,dimension(:,:)::mazemap
integer::dirx(4)=[1,0,-1,0]
integer::diry(4)=[0,1,0,-1]

contains

subroutine getmap(mazemap,R,C)
  integer,allocatable,dimension(:,:)::mazemap
  integer R,C
  character(50) linereader
  allocate(mazemap(0:R+1,0:C+1))
  mazemap=0
  do i=1,R
    read*,linereader
    do j=1,C
      if(linereader(j:j)=="#")mazemap(i,j)=1
    end do
  end do
end subroutine
end module maze
use maze
integer H,W
logical check,precheck
read*,H,W
check=.true.
call getmap(mazemap,H,W)
do i=1,H
  do j=1,W
    if(mazemap(i,j)==1)then
      precheck=.false.
      do k=1,4
        if(mazemap(i+dirx(k),j+diry(k))==1)precheck=.true.
      end do
      check=check .and. precheck
    endif
  end do
end do

print"(A)",trim(merge("Yes","No ",check))
end