#include <bits/stdc++.h>
const int N = 1e6 + 10;
const int B = 113;
const int HMOD = 1e9 + 9;
int n;
char a[N], b[N];
inline int ord(char ch) {
  if (ch == 'N')
    return 0;
  else if (ch == 'S')
    return 1;
  else if (ch == 'E')
    return 2;
  else
    return 3;
}
int main() {
  int i, x, y, pb;
  scanf("%d", &n);
  scanf("%s %s", a + 1, b + 1);
  n--;
  x = y = 0;
  pb = 1;
  for (i = int(n); i; i--) {
    x = (x + 1LL * pb * (ord(a[i]) ^ 1)) % HMOD;
    y = (1LL * y * B + ord(b[i])) % HMOD;
    if (x == y) {
      printf("NO\n");
      return 0;
    }
    pb = 1LL * pb * B % HMOD;
  }
  printf("YES\n");
  return 0;
}
