#include <bits/stdc++.h>
using namespace std;
long long int seed = 13;
void reverse(string& s) {
  reverse(s.begin(), s.end());
  map<char, char> mapD;
  mapD['N'] = 'S';
  mapD['S'] = 'N';
  mapD['E'] = 'W';
  mapD['W'] = 'E';
  string t;
  for (int i = 0; i < s.length(); ++i) {
    s[i] = mapD[s[i]];
  }
}
int main() {
  int n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  reverse(t);
  bool f = false;
  long long int h1 = 0, h2 = 0;
  long long int temp = 1;
  for (int i = 0; i < s.length() && (!f); ++i) {
    h1 = (h1 * seed + t[i]);
    h2 = h2 + s[n - 2 - i] * temp;
    if (h1 == h2) {
      f = true;
    }
    temp *= seed;
  }
  cout << (f ? "NO" : "YES") << endl;
}
