#include <bits/stdc++.h>
using namespace std;
int read() {
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  int kk = 1, k = 0;
  if (c == '-') kk = -1, c = getchar();
  while (c >= '0' && c <= '9') k = k * 10 + c - '0', c = getchar();
  return kk * k;
}
int l, last[1000000], d;
char s1[1000000], s2[1000000];
int main() {
  l = read() - 1;
  for (int i = 1; i <= l; i++) {
    s1[i] = getchar();
    while (s1[i] < 'A' || s1[i] > 'Z') s1[i] = getchar();
  }
  for (int i = l; i >= 1; i--) {
    s2[i] = getchar();
    while (s2[i] < 'A' || s2[i] > 'Z') s2[i] = getchar();
    if (s2[i] == 'S')
      s2[i] = 'N';
    else if (s2[i] == 'N')
      s2[i] = 'S';
    else if (s2[i] == 'W')
      s2[i] = 'E';
    else if (s2[i] == 'E')
      s2[i] = 'W';
  }
  for (int i = 1; i <= l; i++) {
    int k = last[i - 1];
    while (k && s2[k + 1] != s2[i]) k = last[k];
    if (i != 1 && s2[k + 1] == s2[i])
      last[i] = k + 1;
    else
      last[i] = k;
  }
  for (int i = 1; i <= l; i++) {
    while (s2[d + 1] != s1[i] && d) d = last[d];
    if (s2[d + 1] == s1[i]) d++;
  }
  if (d)
    puts("NO");
  else
    puts("YES");
}
