#include <bits/stdc++.h>
using namespace std;
const int sz = 2e6 + 7;
char f(char c) {
  if (c == 'S') return 'N';
  if (c == 'N') return 'S';
  if (c == 'E') return 'W';
  if (c == 'W') return 'E';
}
char s[sz], ss[sz];
int fail[sz];
int main() {
  int n, L = 0, i;
  cin >> n;
  scanf("%s", s + 1);
  for (i = n - 1; i >= 1; i--) ss[++L] = f(s[i]);
  ss[++L] = '&';
  scanf("%s", s + 1);
  for (i = 1; i < n; i++) ss[++L] = s[i];
  fail[0] = -1;
  for (i = 1; i <= L; i++) {
    int p = fail[i - 1];
    while (p + 1 && ss[p + 1] != ss[i]) p = fail[p];
    fail[i] = p + 1;
  }
  if (fail[L])
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
