#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int n, i;
char s[maxn], t[maxn];
long long ha, hb, pw[maxn], h1[maxn], h2[maxn];
char opp(char c) {
  if (c == 'N') return 'S';
  if (c == 'S') return 'N';
  if (c == 'W') return 'E';
  if (c == 'E') return 'W';
  assert(0);
}
int val(char c) {
  if (c == 'N') return 1;
  if (c == 'S') return 2;
  if (c == 'W') return 3;
  if (c == 'E') return 4;
  assert(0);
}
int main() {
  scanf("%d%s%s", &n, s + 1, t + 1);
  n--;
  pw[0] = 1;
  for (int i = 1; i <= n; i++) {
    pw[i] = 31 * pw[i - 1];
    h1[i] = h1[i - 1] + pw[i] * val(s[i]);
  }
  for (int i = n + 1; i <= n + 2; i++) pw[i] = 31 * pw[i - 1];
  for (int i = 1; i <= n; i++) t[i] = opp(t[i]);
  for (int i = 1; i <= n; i++) h2[i] = h2[i - 1] + pw[i] * val(t[n - i + 1]);
  for (int i = 1; i <= n; i++) {
    ha = (h1[n] - h1[i - 1]);
    hb = h2[n - i + 1] * pw[i - 1];
    if (ha == hb) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
