#include <bits/stdc++.h>
int n;
char a[1000005], b[1000005], dic[130];
int main() {
  dic['W'] = 'E';
  dic['E'] = 'W';
  dic['N'] = 'S';
  dic['S'] = 'N';
  scanf("%d%s%s", &n, a, b);
  unsigned int ha = 0, hb = 0, rol = 1, mul = 233;
  for (int i = n - 2; i >= 0; i--) {
    if ((ha = a[i] * rol + ha) == (hb = dic[b[i]] + hb * mul)) {
      puts("NO");
      return 0;
    }
    rol *= mul;
  }
  puts("YES");
}
