#include <bits/stdc++.h>
using namespace std;
const int MAXN(1e6 + 100);
char a[MAXN], s[MAXN], p[MAXN];
int nx[MAXN], n, m;
bool ans;
inline int read() {
  int f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = x * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
void getnx() {
  nx[0] = -1;
  for (int i = 0, j = -1; i < m;) {
    if (j == -1 || p[i] == p[j]) {
      i++, j++;
      nx[i] = j;
    } else
      j = nx[j];
  }
}
bool kmp() {
  getnx();
  int i = 0, j = 0;
  while (i < n) {
    if (j == -1 || s[i] == p[j])
      i++, j++;
    else
      j = nx[j];
  }
  return j;
}
void init() {
  n = read() - 1;
  ans = false;
  m = n;
  scanf("%s%s", s, a);
}
void solve() {
  for (int i = 0; i < n; i++) {
    if (a[n - i - 1] == 'E') p[i] = 'W';
    if (a[n - i - 1] == 'W') p[i] = 'E';
    if (a[n - i - 1] == 'N') p[i] = 'S';
    if (a[n - i - 1] == 'S') p[i] = 'N';
  }
  ans = kmp();
  printf("%s\n", ans ? "NO" : "YES");
}
int main() {
  init();
  solve();
}
