#include <bits/stdc++.h>
using namespace std;
const int N = 1000100;
char s[N], t[N];
int n, ne[N];
int main() {
  int i, j, k;
  scanf("%d", &n);
  n--;
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (i = 1; i <= n; i++)
    if (t[i] == 'S')
      t[i] = 'N';
    else if (t[i] == 'N')
      t[i] = 'S';
    else if (t[i] == 'W')
      t[i] = 'E';
    else
      t[i] = 'W';
  reverse(s + 1, s + n + 1);
  ne[1] = 0;
  j = 0;
  for (i = 2; i <= n; i++) {
    while ((j) && (s[j + 1] != s[i])) j = ne[j];
    if (s[j + 1] == s[i]) j++;
    ne[i] = j;
  }
  j = 0;
  for (i = 1; i <= n; i++) {
    while ((j) && (s[j + 1] != t[i])) j = ne[j];
    if (s[j + 1] == t[i]) j++;
  }
  if (j)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
