#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
int n;cin>>n;
for(int i=0;i<n;i++){
int x;cin>>x;cin.ignore(1);
string s1,s2;
getline(cin,s1);
getline(cin,s2);
reverse(s1.begin(),s1.end());
if(s1==s2) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}