#include <bits/stdc++.h>
using namespace std;
const int max_n = 1e6 + 5;
int n;
char s1[max_n], s2[max_n];
int h1[max_n], h2[max_n];
int h3[max_n], h4[max_n];
int p = 7919;
int mod1 = 1e9 + 7;
int q = 10000169;
int mod2 = 1e9 + 9;
int powmod(int a, int b, int mod) {
  if (b == 0) return 1;
  int sq = powmod(a, b / 2, mod);
  sq = (sq * 1LL * sq) % mod;
  if (b % 2 == 0)
    return sq;
  else
    return (sq * 1LL * a) % mod;
}
int main() {
  scanf("%d", &(n));
  ;
  scanf("%s", s1);
  scanf("%s", s2);
  n--;
  for (int i = (0); i < (n); ++i) {
    if (s2[i] == 'E')
      s2[i] = 'W';
    else if (s2[i] == 'S')
      s2[i] = 'N';
    else if (s2[i] == 'N')
      s2[i] = 'S';
    else if (s2[i] == 'W')
      s2[i] = 'E';
  }
  h1[n - 1] = (int)s1[n - 1];
  for (int i = (n - 2); i >= (0); --i)
    h1[i] = ((h1[i + 1] * 1LL * p) % mod1 + s1[i]) % mod1;
  h2[n - 1] = (int)s2[n - 1];
  for (int i = (n - 2); i >= (0); --i)
    h2[i] =
        ((powmod(p, n - 1 - i, mod1) * 1LL * s2[i]) % mod1 + h2[i + 1]) % mod1;
  h3[n - 1] = (int)s1[n - 1];
  for (int i = (n - 2); i >= (0); --i)
    h3[i] = ((h3[i + 1] * 1LL * q) % mod2 + s1[i]) % mod2;
  h4[n - 1] = (int)s2[n - 1];
  for (int i = (n - 2); i >= (0); --i)
    h4[i] =
        ((powmod(q, n - 1 - i, mod2) * 1LL * s2[i]) % mod2 + h4[i + 1]) % mod2;
  bool ok = true;
  for (int i = (0); i < (n); ++i) {
    if (h1[i] == h2[i] && h3[i] == h4[i]) ok = false;
  }
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
}
