program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: h,w,i,j
    character(1),allocatable:: a(:,:)
    logical,allocatable:: pass(:,:)
    
    read*, h,w
    allocate(a(w,h),pass(w,h))
    block
        character(w):: inpt_a
        do i=1,h
            read*, inpt_a
            do j=1,w
                a(j,i) = inpt_a(j:j)
            end do
        end do
    end block
    pass(:,:) = .false.
    if (dfs(1,1,pass))then
        print'(a)', 'Possible'
    else
        print'(a)', 'Impossible'
    end if

contains
recursive function dfs(x,y, pass) result(ret)
    integer(int32):: x,y
    integer(int32):: i,j
    logical:: ret, pass(:,:), npass(w,h)
    npass(:,:) = pass(:,:)
    npass(x,y) = .true.
    ret = .false.
    if (x==w .and. y==h) then
        ret = .true.
        do i=1,h
            do j=1,w
                if (a(j,i) == '#' .and. (.not.npass(j,i))) ret=.false.
            end do
        end do
        return
    end if

    if (x+1 <= w)then
        if(a(x+1,y) == '#') ret=ret .or. dfs(x+1,y,npass)
    end if
    if (y+1 <= h) then
        if(a(x,y+1) == '#') ret=ret .or. dfs(x,y+1,npass)
    end if

        
end function
end program name