import std.stdio, std.string, std.conv;

void main()
{
	auto u = readln.chomp, A = u[0], B = u[1], C = u[2];
	auto s = readln.chomp, D = s[0], E = s[1], F = s[2];
	if(A == F && B == E && C == D){
		writeln("YES");
	} else {
		writeln("NO");
	}
}