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