#include <bits/stdc++.h>
using namespace std;
char a[1000100], b[1000100];
int nextt[1000100];
int n;
int ok;
void getnext() {
  int i = -1;
  int j = 0;
  nextt[0] = -1;
  while (j < n) {
    if (i == -1 || a[i] == a[j])
      i++, j++, nextt[j] = i;
    else
      i = nextt[i];
  }
}
void kmp() {
  int i = 0, j = 0;
  while (i < n) {
    if (j == -1 || b[i] == a[j])
      i++, j++;
    else
      j = nextt[j];
  }
  if (j > 0)
    ok = 0;
  else
    ok = 1;
}
int main() {
  cin >> n;
  n--;
  scanf("%s%s", a, b);
  for (int i = 0; i < n; i++) {
    if (a[i] == 'N')
      a[i] = 'S';
    else if (a[i] == 'E')
      a[i] = 'W';
    else if (a[i] == 'S')
      a[i] = 'N';
    else if (a[i] == 'W')
      a[i] = 'E';
  }
  reverse(a, a + n);
  getnext();
  ok = 0;
  kmp();
  if (!ok)
    printf("NO\n");
  else
    printf("YES\n");
}
