#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
char s1[maxn], s2[maxn];
int f[maxn];
void getFail(char *s, int m) {
  f[0] = 0, f[1] = 0;
  for (int i = 1; i < m; i++) {
    int j = f[i];
    while (j && s[i] != s[j]) j = f[j];
    f[i + 1] = s[i] == s[j] ? j + 1 : 0;
  }
}
void find(int m) {
  getFail(s1, m);
  int j = 0;
  for (int i = 0; i < m; i++) {
    while (j && s1[j] != s2[i]) j = f[j];
    if (s1[j] == s2[i]) ++j;
  }
  if (j)
    printf("NO\n");
  else
    printf("YES\n");
}
int main() {
  int m;
  scanf("%d%s%s", &m, s1, s2);
  --m;
  reverse(s1, s1 + m);
  for (int i = 0; i < m; 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';
  find(m);
  return 0;
}
