#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000000 + 10;
int n, len, fail[maxn];
char s[maxn], r[128];
inline void Get_Fail() {
  int i = 0, j = -1;
  fail[0] = -1;
  while (i != len)
    if (j == -1 || s[i] == s[j])
      fail[++i] = ++j;
    else
      j = fail[j];
}
int main() {
  scanf("%d\n", &n);
  n -= 2;
  r['N'] = 'S', r['S'] = 'N', r['E'] = 'W', r['W'] = 'E';
  for (int i = n; i >= 0; i--) s[i] = r[getchar()];
  s[n + 1] = ' ';
  getchar();
  len = 2 * (n + 1) + 1;
  for (int i = n + 2; i <= len; i++) s[i] = getchar();
  Get_Fail();
  if (fail[len])
    puts("NO");
  else
    puts("YES");
  return 0;
}
