Problem:
Score : 100 points

Problem Statement

You are given a grid with 2 rows and 3 columns of squares.
The color of the square at the i-th row and j-th column is represented by the character C_{ij}.

Write a program that prints YES if this grid remains the same when rotated 180 degrees, and prints NO otherwise.

Constraints

C_{i,j}(1 \leq i \leq 2, 1 \leq j \leq 3) is a lowercase English letter.

Input

Input is given from Standard Input in the following format:

C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}

Output

Print YES if this grid remains the same when rotated 180 degrees; print NO otherwise.

Sample Input 1

pot
top

Sample Output 1

YES

This grid remains the same when rotated 180 degrees.

Sample Input 2

tab
bet

Sample Output 2

NO

This grid does not remain the same when rotated 180 degrees.

Sample Input 3

eye
eel

Sample Output 3

NO

Solution in Java8 (OpenJDK 1.8.0) (judge verdict: Accepted)

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.stream.Collectors;

public class Main {

	public final static String YES = "YES";
	public final static String NO = "NO";

	public static void main(String[] args) {

		Main myself = new Main();
		myself.execute();

	}

	/**
	 * 実処理メソッド
	 */
	public void execute() {

		final List<String> lines = readStdin();

		final InputData inputData = parse(lines);

		System.out.print(inputData.isSameOnRotateing180() ? YES : NO);

	}

	/**
	 * @return
	 */
	private List<String> readStdin() {
		List<String> lines = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)).lines()
				.collect(Collectors.toList());
		return lines;
	}

	/**
	 * @param inputlines
	 * @return
	 */
	private InputData parse(List<String> inputlines) {

		InputData data = new InputData();

		String firstLine = inputlines.get(0);
		String secondLine = inputlines.get(1);

		data.c11 = firstLine.charAt(0);
		data.c12 = firstLine.charAt(1);
		data.c13 = firstLine.charAt(2);

		data.c21 = secondLine.charAt(0);
		data.c22 = secondLine.charAt(1);
		data.c23 = secondLine.charAt(2);

		return data;
	}

	/**
	 * 
	 *
	 */
	private class InputData implements Serializable {

		/**
		 * 
		 */
		private static final long serialVersionUID = -6938809350516466787L;

		/**
		 * 
		 */
		public char c11;

		/**
		 * 
		 */
		public char c12;

		/**
		 * 
		 */
		public char c13;

		/**
		 * 
		 */
		public char c21;

		/**
		 * 
		 */
		public char c22;

		/**
		 * 
		 */
		public char c23;

		/*
		 * (non-Javadoc)
		 * 
		 * @see java.lang.Object#toString()
		 */
		public boolean isSameOnRotateing180() {

			return c11 == c23 && c12 == c22 && c13 == c21;
		}

	}

}