#include <bits/stdc++.h>
using namespace std;
char opposite(char x) {
  if (x == 'N') return 'S';
  if (x == 'S') return 'N';
  if (x == 'W') return 'E';
  if (x == 'E') return 'W';
}
const int N = 1e6 + 5;
char s[2 * N];
int p[2 * N];
int main() {
  int n;
  scanf("%d", &n);
  --n;
  scanf("%s\n%s", s + 1, s + n + 1);
  for (int i = 1; i < n + 1 - i; ++i) swap(s[i], s[n + 1 - i]);
  for (int i = 1; i <= n; ++i) s[i] = opposite(s[i]);
  p[1] = p[0] = 0;
  int t = p[1];
  for (int i = 2; i <= 2 * n; ++i) {
    while (t != 0 && s[t + 1] != s[i]) t = p[t];
    if (s[t + 1] == s[i]) ++t;
    p[i] = t;
  }
  printf(p[2 * n] == 0 ? "YES\n" : "NO\n");
  return 0;
}
