#include <bits/stdc++.h>
const int N = 1e6 + 100;
int n;
char a[N], b[N];
void init() {
  std::cin >> n >> (a + 1) >> (b + 1);
  n--;
}
void work() {
  for (int i = 1; i <= n; i++) {
    if (a[i] == 'N') {
      a[i] = 'S';
    } else if (a[i] == 'S') {
      a[i] = 'N';
    } else if (a[i] == 'W') {
      a[i] = 'E';
    } else if (a[i] == 'E') {
      a[i] = 'W';
    }
  }
  std::reverse(b + 1, b + n + 1);
  static int next[N];
  next[0] = next[1] = 0;
  for (int i = 2; i <= n; i++) {
    int step = next[i - 1];
    while (step != 0 && b[step + 1] != b[i]) {
      step = next[step];
    }
    if (b[step + 1] == b[i]) {
      next[i] = step + 1;
    } else {
      next[i] = 0;
    }
  }
  int cur = 0;
  for (int i = 1; i <= n; i++) {
    while (cur != 0 && b[cur + 1] != a[i]) {
      cur = next[cur];
    }
    if (b[cur + 1] == a[i]) {
      cur++;
    } else {
      cur = 0;
    }
  }
  if (cur == 0) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}
int main() {
  init();
  work();
  return 0;
}
