#include <bits/stdc++.h>
using namespace std;
const int _N = 1000010;
int n, Next[_N];
char a[_N], b[_N];
int main() {
  scanf("%d", &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] == 'W')
      a[i] = 'E';
    else
      a[i] = 'N';
  }
  for (int i = 0; i << 1 < n; i++) swap(b[i], b[n - i - 1]);
  Next[0] = Next[1] = 0;
  for (int i = 1, j = 0; i < n; i++) {
    while (j && b[i] != b[j]) j = Next[j];
    if (b[i] == b[j]) ++j;
    Next[i + 1] = j;
  }
  static int now;
  for (int i = 0, j = 0; i < n; i++) {
    while (j && a[i] != b[j]) j = Next[j];
    if (a[i] == b[j]) ++j;
    now = j;
  }
  printf(now ? "NO\n" : "YES\n");
  return 0;
}
