#include <bits/stdc++.h>
inline void swap(char &a, char &b) {
  int tmp = a;
  a = b;
  b = tmp;
}
inline void read(int &x) {
  x = 0;
  char ch = getchar(), c = ch;
  while (ch < '0' || ch > '9') c = ch, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  if (c == '-') x = -x;
}
const int MAXN = 1000000 + 10;
int n, nxt[MAXN];
char s1[MAXN], s2[MAXN];
inline void yuchuli() {
  nxt[0] = -1;
  for (register int i = 1, j = -1; i < n; ++i) {
    while (j >= 0 && s1[j + 1] != s1[i]) j = nxt[j];
    if (s1[j + 1] == s1[i]) ++j;
    nxt[i] = j;
  }
}
int KMP() {
  for (register int i = 0, j = -1; i < n; ++i) {
    while (j >= 0 && s1[j + 1] != s2[i]) j = nxt[j];
    if (s1[j + 1] == s2[i]) ++j;
    if (i == n - 1 && j >= 0) return 1;
  }
  return 0;
}
int main() {
  read(n);
  scanf("%s", s1);
  scanf("%s", s2);
  --n;
  for (register int i = 0; i < n; ++i) {
    if (s1[i] == 'N')
      s1[i] = 'S';
    else if (s1[i] == 'S')
      s1[i] = 'N';
    else if (s1[i] == 'W')
      s1[i] = 'E';
    else
      s1[i] = 'W';
  }
  for (register int i = n / 2 - 1; i >= 0; --i) swap(s1[i], s1[n - i - 1]);
  yuchuli();
  if (KMP())
    printf("NO");
  else
    printf("YES");
  return 0;
}
