#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  n--;
  char s1[n + 1], s2[n + 1];
  scanf("%s%s", s1, s2);
  char r1[n + 1];
  r1[n] = '\0';
  for (int i = 0; i < n; ++i) {
    if (s1[i] == 'N') r1[n - i - 1] = 'S';
    if (s1[i] == 'E') r1[n - i - 1] = 'W';
    if (s1[i] == 'S') r1[n - i - 1] = 'N';
    if (s1[i] == 'W') r1[n - i - 1] = 'E';
  }
  int b[n];
  b[0] = 0;
  for (int i = 1; i < n; ++i) {
    int j = b[i - 1];
    for (; r1[j] != r1[i] && j != 0; j = b[j - 1])
      ;
    b[i] = r1[j] == r1[i] ? j + 1 : 0;
  }
  int m = 0;
  for (int i = 0; i < n; ++i) {
    while (r1[m] != s2[i] && m != 0) m = b[m - 1];
    if (r1[m] == s2[i]) m++;
  }
  if (m)
    puts("NO");
  else
    puts("YES");
}
