unittest
{
	assert( [ "pot", "top" ].parse.expand.solve == "YES" );
	assert( [ "tab", "bet" ].parse.expand.solve == "NO" );
	assert( [ "eye", "eel" ].parse.expand.solve == "NO" );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto css = new string[ 2 ];
	foreach( ref cs; css )
	{
		cs = input.front.strip;
		input.popFront;
	}
	return tuple( css );
}

auto solve( string[] css )
{
	return ( css[ 0 ][ 0 ] == css[ 1 ][ 2 ] &&
	         css[ 0 ][ 1 ] == css[ 1 ][ 1 ] &&
	         css[ 0 ][ 2 ] == css[ 1 ][ 0 ] ) ? "YES" : "NO";
}
