Chotu and Palindromic Strings

3.5

2 votes
Very-Easy
Problem

Everyone knows that chotu likes palindromic strings. One day, he found 2 ordinary strings s1 and s2. Now he wonders if he could make a palindrome by concatenating s1 and s2 in any order. i.e if s1s2 or s2s1 is a palindrome.

Input
First line of input contains T, denoting number of test cases.
Each test case contains two lines, first line contains string s1 and second line contains string s2.

Output
Print T lines, either "YES" or "NO"(without quotes).

Constrains
1 <= T <= 1000
1 <= |s1|, |s2| <= 10000
Both strings contain only lower case letters.

Sample Input
2
aba
baba
xy
zw
Sample Output
YES
NO
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?