#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const long double PI = atan2((long double)0, (long double)-1);
const long long MOD = 1000000007;
const int INF = 1 << 30;
const int ARR_INF = 1 << 6;
const int MAXN = 1000005;
char tar[MAXN], pat[MAXN], repat[MAXN];
int nxt[MAXN];
void GetFail() {
  int m = strlen(pat);
  nxt[0] = 0;
  nxt[1] = 0;
  for (int i = 1; i < m; i++) {
    int j = nxt[i];
    while (j && pat[i] != pat[j]) j = nxt[j];
    nxt[i + 1] = pat[i] == pat[j] ? j + 1 : 0;
  }
  return;
}
bool KMP() {
  int n = strlen(tar);
  int m = strlen(pat);
  GetFail();
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (j && pat[j] != tar[i]) j = nxt[j];
    if (pat[j] == tar[i]) {
      j++;
      if (i == n - 1) return false;
    }
  }
  return true;
}
char Trans(char c) {
  if (c == 'W') return 'E';
  if (c == 'E') return 'W';
  if (c == 'N') return 'S';
  if (c == 'S') return 'N';
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    scanf("%s", tar);
    scanf("%s", repat);
    for (int i = 0; i < n - 1; i++) pat[i] = Trans(repat[n - i - 2]);
    if (KMP())
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
