#include <bits/stdc++.h>
using namespace std;
vector<int> kmp(const string &s) {
  vector<int> f(s.size());
  int fp = f[0] = -1;
  for (int i = 1; i < s.size(); ++i) {
    while (~fp && s[fp + 1] != s[i]) fp = f[fp];
    f[i] = fp += s[fp + 1] == s[i];
  }
  return f;
}
signed main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  string A, B;
  cin >> A >> B;
  string ra;
  for (int i = A.size() - 1; i >= 0; --i) {
    if (A[i] == 'N') ra += 'S';
    if (A[i] == 'S') ra += 'N';
    if (A[i] == 'W') ra += 'E';
    if (A[i] == 'E') ra += 'W';
  }
  vector<int> f = kmp(ra + "$" + B);
  cout << vector<string>({"NO", "YES"})[!(f.back() + 1)] << endl;
  return 0;
}
