#include <bits/stdc++.h>
using namespace std;
char a[2111111], b[2111111];
int N;
int M;
char needle[2111111];
int fail[2111111];
void failure() {
  int k;
  fail[0] = -1;
  for (int i = (1); i <= (M); i++) {
    for (k = fail[i - 1]; k >= 0 && needle[k] != needle[i - 1]; k = fail[k])
      ;
    fail[i] = k + 1;
  }
}
int main(int argc, char *argv[]) {
  scanf("%d", &N);
  N--;
  scanf("%s", a);
  scanf("%s", b);
  M = 2 * N;
  for (int i = 0; i < (N); i++) needle[N + i] = a[i];
  for (int i = 0; i < (N); i++) {
    int pos = N - i - 1;
    char c = b[i];
    if (c == 'N')
      c = 'S';
    else if (c == 'S')
      c = 'N';
    else if (c == 'W')
      c = 'E';
    else if (c == 'E')
      c = 'W';
    needle[pos] = c;
  }
  failure();
  if (fail[M])
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
