#include <bits/stdc++.h>
using namespace std;
const int mxn = 1000006;
int n;
char a[mxn];
char b[mxn];
map<char, char> tr = {{'E', 'W'}, {'W', 'E'}, {'S', 'N'}, {'N', 'S'}};
int p[mxn];
void KMP(char *s, int *p, int n) {
  p[0] = -1;
  int t = -1;
  for (int i = 1; i <= n; ++i) {
    while (t >= 0 && s[t + 1] != s[i]) t = p[t];
    p[i] = ++t;
  }
}
void EXEC() {
  scanf("%d", &n);
  --n;
  scanf("%s", a);
  scanf("%s", b);
  reverse(b, b + n);
  for (int i = 0; i < n; ++i) b[i] = tr[b[i]];
  KMP(b - 1, p, n);
  int t = 0;
  for (int i = 0; i < n; ++i) {
    while (t >= 0 && (b - 1)[t + 1] != a[i]) t = p[t];
    ++t;
  }
  puts(t ? "NO" : "YES");
}
int main() {
  EXEC();
  return 0;
}
