#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int maxn = 1e6 + 10;
unsigned long long x[5] = {131, 173, 997, 911, 509};
int n;
char s[2][maxn];
const char* tr = "NESW";
unsigned long long p[5][maxn];
int main() {
  cin >> n;
  for (int t = (0); t < (2); ++t) cin >> s[t];
  reverse(s[0], s[0] + n - 1);
  for (int t = (0); t < (n - 1); ++t) {
    char& c = s[0][t];
    int r;
    for (int t = (0); t < (4); ++t)
      if (tr[t] == c) r = t;
    c = tr[(r + 2) % 4];
  }
  for (int t = (0); t < (5); ++t) {
    p[t][0] = 1;
    for (int i = (1); i < (maxn); ++i) p[t][i] = p[t][i - 1] * x[t];
  }
  int ok = 5;
  --n;
  for (int t = (0); t < (5); ++t) {
    unsigned long long a = 0, b = 0;
    for (int i = (0); i < (n); ++i) {
      a += s[0][i] * p[t][i], b += s[1][n - 1 - i] * p[t][n - 1 - i];
      if (a * p[t][n - 1 - i] == b) {
        --ok;
        break;
      }
    }
  }
  if (ok)
    puts("YES");
  else
    puts("NO");
}
