#include <bits/stdc++.h>
using namespace std;
int N, P[3], a[3], b[3];
map<char, char> h;
int p[] = {666013, 100003, 544513};
int m[] = {123456, 555123, 100055};
string s, t;
int main() {
  std::ios_base::sync_with_stdio(false);
  h['N'] = 'S';
  h['S'] = 'N';
  h['E'] = 'W';
  h['W'] = 'E';
  cin >> N >> s >> t;
  --N;
  for (int i = 0; i < N; ++i) {
    s[i] = h[s[i]];
  }
  P[0] = 1;
  P[1] = 1;
  P[2] = 1;
  for (int i = N - 1; i >= 0; --i) {
    bool ok = 1;
    for (int j = 0; j < 3; ++j) {
      a[j] = (1LL * p[j] * a[j] + s[i]) % m[j];
      b[j] = (1LL * P[j] * t[i] + b[j]) % m[j];
      if (a[j] != b[j]) ok = 0;
      P[j] = (1LL * P[j] * p[j]) % m[j];
    }
    if (ok) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
