#include<iostream>
#include<cstdio> 
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#include<math.h>

#define MAXN 0x7fffffff

using namespace std;

int m,n,i,j,k,p,q,l,flag=0;
char grid[2][2],a;

int main(){
	for(i=1;i<=2;i++){
		for(j=1;j<=3;j++){
			scanf("%c",&grid[i][j]);
		}
		getchar();
	}
	if(grid[1][1]!=grid[2][3]){
		printf("NO");
		return 0;
	}
	if(grid[1][2]!=grid[2][2]){
		printf("NO");
		return 0;
	}
	if(grid[1][3]!=grid[2][1]){
		printf("NO");
		return 0;
	}
	printf("YES");
	return 0;
} 