#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int MAXN = 1000000;
int n, N, TO[128], seq[2 * MAXN + 5], Z[2 * MAXN + 5];
char s1[MAXN + 5], s2[MAXN + 5];
void getZ() {
  int F = -1, R = -1;
  Z[0] = N;
  for (int k = 1; k < N; k++) {
    if (R <= k) {
      for (Z[k] = 0; k + Z[k] < N && seq[Z[k]] == seq[k + Z[k]]; Z[k]++)
        ;
      if (k + Z[k] >= R) {
        R = k + Z[k];
        F = k;
      }
    } else {
      Z[k] = min(Z[k - F], R - k);
      if (k + Z[k] >= R) {
        R = k + Z[k];
        F = k;
        for (; k + Z[k] < N && seq[Z[k]] == seq[k + Z[k]]; Z[k]++) R++;
      }
    }
  }
}
int main() {
  TO['N'] = 0;
  TO['S'] = 1;
  TO['E'] = 2;
  TO['W'] = 3;
  scanf("%d%s%s", &n, s1, s2);
  n--;
  N = n + n;
  for (int k = 0; k < (n); k++) seq[n - k - 1] = TO[s1[k]];
  for (int k = 0; k < (n); k++) seq[n + k] = TO[s2[k]] ^ 1;
  getZ();
  for (int k = 0; k < (n); k++)
    if (Z[k + n] + k >= n) {
      printf("NO");
      return 0;
    }
  printf("YES");
  return 0;
}
