#include <bits/stdc++.h>
char a[1000000 + 5], b[1000000 + 5], v[256];
long long p[1000000 + 5], as, bs;
int main() {
  int n, i;
  scanf("%d%s%s", &n, a + 1, b + 1);
  v['N'] = 'S';
  v['S'] = 'N';
  v['E'] = 'W';
  v['W'] = 'E';
  for (p[0] = i = 1; i < n; ++i) p[i] = p[i - 1] * 233 % 666233998244353;
  for (i = n; --i;) {
    as = (as + p[n - i - 1] * a[i]) % 666233998244353;
    bs = (bs * 233 + v[b[i]]) % 666233998244353;
    if (as == bs) return 0 * puts("NO");
  }
  puts("YES");
}
