#include <bits/stdc++.h>
using namespace std;
const long long INF = 1E9 + 9;
const int MI = ~0u >> 1;
const int maxn = 1111111;
int fail[maxn];
void getnext(char s[]) {
  fail[0] = -1;
  int len = strlen(s);
  int k = -1, j = 0;
  while (j < len) {
    if (k == -1 || s[k] == s[j]) {
      k++;
      j++;
      if (s[k] == s[j])
        fail[j] = fail[k];
      else
        fail[j] = k;
    } else
      k = fail[k];
  }
}
int main() {
  int n;
  char s1[maxn], s2[maxn];
  scanf("%d%s%s", &n, s1, s2);
  n--;
  for (int i = 0; i < n; i++) {
    switch (s2[i]) {
      case 'N':
        s2[i] = 'S';
        break;
      case 'S':
        s2[i] = 'N';
        break;
      case 'W':
        s2[i] = 'E';
        break;
      case 'E':
        s2[i] = 'W';
        break;
    }
  }
  for (int i = 0, j = n - 1; i < j; i++, j--) swap(s2[i], s2[j]);
  getnext(s2);
  for (int i = 0, k = 0; i < n; i++, k++) {
    while (k != -1 && s1[i] != s2[k]) k = fail[k];
    if (k >= 0 && i == n - 1) {
      printf("NO");
      return 0;
    }
  }
  printf("YES");
  return 0;
}
