#include <bits/stdc++.h>
char r[128], s[2000000];
int n;
int fail[2000000];
void kmp(char* s, int n) {
  fail[0] = -1;
  int i, lst;
  for (i = 1; i <= n; i++) {
    for (lst = fail[i - 1]; lst != -1 && s[lst + 1] != s[i]; lst = fail[lst])
      ;
    fail[i] = lst + 1;
  }
}
int main() {
  r['E'] = 'W', r['W'] = 'E', r['S'] = 'N', r['N'] = 'S';
  scanf("%d\n", &n);
  int p = n - 1;
  while (p) s[p--] = r[getchar()];
  s[n] = '#', p = n + 1, n <<= 1, getchar();
  while (p < n) s[p++] = getchar();
  kmp(s, --n);
  return puts(fail[n] < 1 ? "yes" : "no"), 0;
}
