unittest
{
	assert( [ "4 5", "##...", ".##..", "..##.", "...##" ].parse.expand.solve == "Possible" );
	assert( [ "5 3", "###", "..#", "###", "#..", "###" ].parse.expand.solve == "Impossible" );
	assert( [ "4 5", "##...", ".###.", ".###.", "...##" ].parse.expand.solve == "Impossible" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto hw = input.front.split.to!( long[] );
	auto ass = new dchar[][]( hw[ 0 ], hw[ 1 ] );
	foreach( ref as; ass )
	{
		input.popFront;
		as = input.front.to!( dchar[] );
	}
	return tuple( ass );
}

auto solve( dchar[][] ass )
{
	auto y = 0L;
	auto x = 0L;
	while( !( y + 1 == ass.length && x + 1 == ass[ y ].length ) )
	{
		auto nd = ( y + 1 < ass.length      && ass[ y + 1 ][ x ] == '#' );
		auto nr = ( x + 1 < ass[ y ].length && ass[ y ][ x + 1 ] == '#' );
		if( nd && nr ) break;		// ルートが分岐してたらダメ
		
		if( nd )
		{
			y++;
			if( 0 < x && ass[ y ][ x - 1 ] == '#' ) break;		// ルートの先が左に曲がっていたらダメ
		}
		if( nr )
		{
			x++;
			if( 0 < y && ass[ y - 1 ][ x ] == '#' ) break;		// ルートの先が上に曲がっていたらダメ
		}
	}
	return ( y + 1 == ass.length && x + 1 == ass[ y ].length ) ? "Possible" : "Impossible";
}
